Last week we renamed a file server, and I needed to dig through all of my Powershell scripts and change the name wherever it was referenced. What a tedious chore!
Oh how I wished there was a tool that would search inside of multiple text files and tell me where a string of text appears!
THERE IS!
It's called Grep for Windows, and it is awesome. It's wizard driven and will even search based on regular expressions.
Click an Ad
If you find this blog helpful, please support me by clicking an ad!
Friday, June 21, 2013
Wednesday, June 19, 2013
Windows 8 - Mini-Review, and My Ability to Switch Users went Missing!
I'll get to the actual fix towards the bottom, but let me diverge into my mini-review of Windows 8 for a couple of paragraphs first.
This weekend I took the plunge and installed Windows 8 on my home desktop. I took full advantage of that promo that Microsoft had back in January and picked up Windows 8 for $30. I still think Windows 8 is a "failure" for the business segment due to so many business users being, well, fairly clueless when it comes to technology. I also have come to believe that humanity in general despises change and lacks a yearning to learn new things, especially when the old way "works just fine". Okay, enough sociology.
I've been using Windows 8 for a few days now, and let me tell you: It has some great features! While the switch to the Metro interface (Start Screen) is jarring, I like that I have big buttons for my most used apps. One of the fixes in 8.1 is that you can make the wallpaper on your Start Screen the same as your desktop wallpaper, so that should help. The live tiles are less useful on a desktop, but I can see their allure. Some of the built in apps are pretty barebones, but there's a store and I can get more apps. The first thing I found was TuneIn, which lets me listen to terrestrial radio stations from all over the planet - awesome! Half the time when I hit the start button on my keyboard I am typing the thing that I want to open anyway, so my use of the start screen is fairly limited. One thing I overlooked about the big buttons is the ability to "remind" myself that I need to do something, like check my torrents, for instance. When I press start now there's my big green uTorrent button staring at me.
The second thing that I really like is the parental control. I have a 12 year old, and now I can look at where he's going on the web independent on whether he figures out how to clear his history. I hear you now: "But why don't you just set up a Squid proxy or something - you're a geek!" This is an option I have thought of many times, but I don't want to pay the electric bill and deal with the management (at home, no less) of yet another system. I also have him locked down with an application whitelist, so that he can only run things I say that he can ahead of time. The cherry on top is that I can specify when he can log on, so no more worrying about him sneaking down in the middle of the night. I'm pretty sure I could have done this via group policy before, but I like that it's now an easy to find option.
So, I got this thing all configured and then I noticed that I didn't have the ability to "switch user" anymore. What was odd is that it was working just fine. I have no idea what caused it to go away since I was doing so many thing (it's a new install after all). After hunting around I finally found a group policy option that fixed the problem.
1. Hold down your Windows key and press 'R' to open the Run Command box.
2. Type 'gpedit.msc' and press enter. This open Group Policy Management.
3. Navigate to Local Computer Policy/Computer Configuration/Administrative Templates/System/Logon
4. Within the Logon folder, you will see "Hide Entry Points for Fast User Switching". Right-click on it and select Edit.
5. Change the setting to "Enabled" and then press OK.
6. Close the Local Group Policy Editor
7. Hold down your Windows key and press 'R' to open the Run Command box.
8. Type 'gpupdate /force' and press enter, then wait for the black box to go away. Or you can reboot.
That's it.
This weekend I took the plunge and installed Windows 8 on my home desktop. I took full advantage of that promo that Microsoft had back in January and picked up Windows 8 for $30. I still think Windows 8 is a "failure" for the business segment due to so many business users being, well, fairly clueless when it comes to technology. I also have come to believe that humanity in general despises change and lacks a yearning to learn new things, especially when the old way "works just fine". Okay, enough sociology.
I've been using Windows 8 for a few days now, and let me tell you: It has some great features! While the switch to the Metro interface (Start Screen) is jarring, I like that I have big buttons for my most used apps. One of the fixes in 8.1 is that you can make the wallpaper on your Start Screen the same as your desktop wallpaper, so that should help. The live tiles are less useful on a desktop, but I can see their allure. Some of the built in apps are pretty barebones, but there's a store and I can get more apps. The first thing I found was TuneIn, which lets me listen to terrestrial radio stations from all over the planet - awesome! Half the time when I hit the start button on my keyboard I am typing the thing that I want to open anyway, so my use of the start screen is fairly limited. One thing I overlooked about the big buttons is the ability to "remind" myself that I need to do something, like check my torrents, for instance. When I press start now there's my big green uTorrent button staring at me.
The second thing that I really like is the parental control. I have a 12 year old, and now I can look at where he's going on the web independent on whether he figures out how to clear his history. I hear you now: "But why don't you just set up a Squid proxy or something - you're a geek!" This is an option I have thought of many times, but I don't want to pay the electric bill and deal with the management (at home, no less) of yet another system. I also have him locked down with an application whitelist, so that he can only run things I say that he can ahead of time. The cherry on top is that I can specify when he can log on, so no more worrying about him sneaking down in the middle of the night. I'm pretty sure I could have done this via group policy before, but I like that it's now an easy to find option.
So, I got this thing all configured and then I noticed that I didn't have the ability to "switch user" anymore. What was odd is that it was working just fine. I have no idea what caused it to go away since I was doing so many thing (it's a new install after all). After hunting around I finally found a group policy option that fixed the problem.
1. Hold down your Windows key and press 'R' to open the Run Command box.
2. Type 'gpedit.msc' and press enter. This open Group Policy Management.
3. Navigate to Local Computer Policy/Computer Configuration/Administrative Templates/System/Logon
4. Within the Logon folder, you will see "Hide Entry Points for Fast User Switching". Right-click on it and select Edit.
5. Change the setting to "Enabled" and then press OK.
6. Close the Local Group Policy Editor
7. Hold down your Windows key and press 'R' to open the Run Command box.
8. Type 'gpupdate /force' and press enter, then wait for the black box to go away. Or you can reboot.
That's it.
Tuesday, June 18, 2013
Windows Updates for Labs Without an Internet Connection
I'm often building lab environments that have no ability to get online. This is usually because some of the VMs I build have the same name as actual production systems. Some of them are even restores of production VMs in a lab environment. Naming conflicts suck, especially in the middle of the day.
I found a great tool called WSUS Offline Update that lets me put all of the WSUS updates I want onto a virtual DVD and update my OS from it. I wish I had it back in the day when I was updating remote offices on a slow and shared internet connection! It's well-built and fairly granular - you can pick and choose OS, Architecture, etc. It will even do Office and .NET!
I found a great tool called WSUS Offline Update that lets me put all of the WSUS updates I want onto a virtual DVD and update my OS from it. I wish I had it back in the day when I was updating remote offices on a slow and shared internet connection! It's well-built and fairly granular - you can pick and choose OS, Architecture, etc. It will even do Office and .NET!
Friday, June 14, 2013
Running Scheduled Reports in Spiceworks
We love Spiceworks! BUT it's still missing some things. One of which is the ability to set up reports to run automatically and email them to you. Well, it's not missing per se, it's just kind of complicated. The ability is there, and this is how to use it.
The post here within the Spiceworks Community got me started, but I wanted to show the whole picture.
The post here within the Spiceworks Community got me started, but I wanted to show the whole picture.
- On your Spiceworks server, go to c:\Program Files (x86)\Spiceworks and create a new folder called 'rpt'.
- Now go into c:\Program Files (x86)\Spiceworks\pkg\gems\spiceworks-X.X.XXXXX (where the X's represent your version number), and copy the file run_report.rb into the rpt folder you created in step 1.
- Open a command prompt and navigate to c:\Program Files (x86)\Spiceworks\rpt and execute the following command to see how to use this ruby script: ..\bin\ruby run_report.rb -?
- Now, you need to find the report number that corresponds to the report you want to run. In my case, I used the following command: ..\bin\ruby run_report.rb -e user@contoso.com -p password -l
- Your Spiceworks login credentials are used in the above command, as well as -l, which lists all reports, along with their report numbers. Write down the report numbers you want.
- In a batch file, write a line for each report. Here is an altered copy of my batch file:
cd "C:\Program Files (x86)\Spiceworks\rpt"
REM To get a list of tickets run this command:
REM ..\bin\ruby run_report.rb -e user@contoso.com -p password -f pdf -l
REM Run Report #72
..\bin\ruby run_report.rb -e user@contoso.com -p password -f pdf 72
REM Run Report #73
..\bin\ruby run_report.rb -e user@contoso.com -p password -f pdf 73
REM Run Report #74
..\bin\ruby run_report.rb -e user@contoso.com -p password -f pdf 74
powershell.exe -NoProfile -File C:\ps\SpiceworksReporting.ps1 - Pay attention to the last line, which calls a powershell script that will email you the reports! Here's that file:
#This file is run at the tail-end of SpiceworksReporting.bat
$To = "admin@contoso.com"
$From = "spiceworks@contoso.com"
$Subject = "Spiceworks Reports"
$SMTPServer = "smtpserver.contoso.com"
$Body = "See Attached File(s)"
#Report 1:
$file1 = "C:\Program Files (x86)\Spiceworks\rpt\report-72.pdf"
#Report 2:
$file2 = "C:\Program Files (x86)\Spiceworks\rpt\report-73.pdf"
#Report 3:
$file3 = "C:\Program Files (x86)\Spiceworks\rpt\report-78.pdf"
#Send Email
Send-MailMessage -To $To -From $From -SMTPServer $SMTPServer -Subject $Subject -Body $Body -Attachments $file1,$file2, $file3
Remove-Item $file1
Remove-Item $file2
Remove-Item $file3 - Now, go into Task Scheduler and create a task to run the batch file. The batch file creates the reports, which output into pdf and are stored in the rpt folder we create. Then, the batch file calls the Powershell script which emails these files as attachments and then deletes the PDF files that were created.
Voila! You have automated Spiceworks reports!
Subscribe to:
Posts (Atom)