Tim here...
I am attempting to write a script that looks at my Active Directory for specific OUs where I have Policies set to run Windows Updates. I have everything working as I would want. My issue is in the command:
Get-WSUSClient
I feed into this command via a foreach loop, a list of computer names. However, if a computer name is similar I can get conflicting results. Example:
Get-WSUSClient -computer "serverA"
This can return:
serverA
NEWserverA
OLDserverA
How can I ensure that only "serverA" is selected?
What I am attempting to do is to automate the placement of each system into the correct WSUS Computer Group by just adding the system in the correct AD OU.
I have it working and I can Add-WSUSClientToGroup or Remove-WSUSClientFromGroup as long as the names are not similar like my example. When they are similar I can get those systems in the wrong group which will cause those systems to update and reboot out side of their specific schedule.
Thanks in advance,
Tim now going over there...