-
Recent Posts
Recent Comments
Archives
Categories
Meta
Monthly Archives: June 2011
PowerShell–Running a script from a bat file
You may have a need to run a PS1 script at a certain schedule. The easiest way to do this is using a bat file. However, your systems (servers at least!) should have the ExecutionPolicy set to Default which means … Continue reading
Posted in Uncategorized
Leave a comment
PowerShell–Displaying information from Hash Tables
Let’s say you have a CSV file that you want to import into a hash table. The contents of the CSV file are as follows: srv, os DC1, Windows Server 2008R2Full Win7, Windows 7 The following code shows the incorrect … Continue reading
Posted in Uncategorized
1 Comment
PowerShell–AD Module
Searching AD for a specific attribute using the get-aduser function from the ActiveDirectory PowerShell module. First the ActiveDirectory module needs to be loaded. You can check to see if the module is available by typing: Get-Module -listavailable If you don’t … Continue reading
Posted in Uncategorized
Leave a comment
PowerShell–Get ACL with a readable path
When you want to run the Get-Acl cmdlet against a directory, the path property in the results is a bit messy. Example: Get-Childitem C:\Labs -recurse | Get-Acl | Format List Path, Owner, Access We can clean up the Path property … Continue reading
Posted in Uncategorized
Leave a comment
Powershell–Comparing processes
This week I am teaching a PowerShell v2.0 class at Benchmark Learning. During the class I usually show the following demo. # Get the current running processes $Baseline = Get-Process # Create some new processes Calc Notepad # Capture the … Continue reading
Posted in Uncategorized
Leave a comment
Using SQL to list the Site Servers, Roles and Boundaries of the SCCM Hierarchy
Today I was trying to gather a list of all of our site servers and roles. I then wanted to find out what site servers were protected. The built in reports the SCCM provides did not have all this information. … Continue reading
Posted in Uncategorized
Leave a comment
Using SCCM to get Local User Group Membership and Local User Password Expiration
Recently the server team asked me if SCCM could gather Local Group Membership and Local User Password Expiration. After a bit of Googling, I found an article by Sherry Kissenger (isn’t she just the best!). The article describes how to … Continue reading
Posted in Uncategorized
2 Comments
Using PowerShell to get Share and NTFS permissions
I am teaching a class this week at Benchmark Learning and had a great student question. “How do I get share permissions AND NTFS permissions” Well, look no further. The Get-SharePermission function was found here: http://social.technet.microsoft.com/Forums/en-ZA/ITCG/thread/64cabd85-7170-4678-96b5-2c516cc3b772 function Get-SharePermission { Param($Server … Continue reading
Posted in Uncategorized
Leave a comment