Hi all,
We are developing an automation script using PowerShell for Post OS Build checkouts. We typically do checks like specific software installed or not (McAfee, WinZip), Registry changes, Time domain synch and enabling windows features if it is not present ( ISS etc).
This script may be run in following scenario.
from same machine
from remote machine
from remote machine for many servers
Run-PostBuildCheckout -Computer D1,D2 -Verbose
For these above scenario,
Please advise about remote model i can go for…
Create a session for each computer and run the checks (New-PSSession & Invoke-Command)
Directly running command by passing computer in parameter (Get-wmiobject -computername D1)
Any other good method i can follow for this scenario.
I’m not sure it matters, beyond what will work in your environment. Is Remoting available? If so, you could certainly use Invoke-Command. It would likely be more efficient since each computer would run its own checks, vs. WMI calls which would be sequential from the originating computer.
If you have several checks, perhaps Desired State Configuration would be better than developing an extensive script, since that would also remediate any problems. DSC is a WMF4.0 feature.
As a note, more-descriptive post subjects will often solicit more-specific responses. As in, “Performing configuration checks of computers” as opposed to, “Automation help required.” That’s just a suggestion you can consider for future posts. Nearly every post here is in regard to automation help.
I will go for Invoke-Command as i should give the prototype in a short time.
Thanks for the reply. Sure Next time i will be more specific on subject and content.
Thanks again for providing wonderful handy free e-books, that really provides a good insight into PowerShell