Finding Group Policy Processing Time Using Microsoft PowerShell V2.0
About a year ago, I released V1.0 of this script and stated if I ever found the time I would update it to not require XenApp 6.5. Finally, I took the time between customer calls to update this script (and two others).
I added three parameters from the Get-ServiceWithAccountName script to make this script more generic.
By default, the script will search all computers in AD that have “server” in the OperatingSystem property. Use -ComputerName to restrict the search to a specific group of computers. For example, -ComputerName “ctx” will limit the search to only computers that have “ctx” somewhere in the DNSHostName property.
Using -InputFile allows you to create a text file containing computer name to search. The computer names can be NetBIOS or Fully Qualified Domain Name. The names contained in the file are not validated. Using -ComputerName will filter the names retrieved from the InputFile.
Using -OrganizationalUnit will restrict the search to computers contained in an OU tree. For example, -OrganizationalUnit “ou=RDS Servers,dc=domain,dc=tld” restricts the computers searched to all computers in that OU tree.
The Get-WinEvent bug still exists. If your PowerShell version is later than version 2 or if your culture is not en-US, then the Message property contains no data. There are two possible workarounds:
1. Start your PowerShell session with the parameter -Version 2. i.e. PowerShell.exe -Version 2
2. Add the following line to the script:
[System.Threading.Thread]::CurrentThread.CurrentCulture = New-Object "System.Globalization.CultureInfo" "en-US"
Thanks, Carl B. for taking the time to report this and help test the two workarounds.
This script is in the Miscellaneous section of the downloads page.
You can always find the most current script by going to https://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/