Jeffrey Renfroe
asked on
Converting WMI type accelerator command to one that can use credentials
Hello. I am working on a PowerShell script to trigger an SCCM baseline evaluation for a specific baseline on a remote server. I want the script to use credentials. For years, I have used the WMI type accelerator to trigger the baseline. Since credentials cannot be passed to it, I have tried others ways without success. Is it possible?
$ServerName = "Server1"
$BaselineName = "Test Baseline"
$BaselineInfo = gwmi -ComputerName $ServerName -Namespace root\ccm\dcm -Class SMS_DesiredConfiguration -Credential $creds | Where {$_.DisplayName -eq $BaselineName}
#Need to use credentials
([wmiclass]"\\$ServerName\root\ccm\dcm:SMS_DesiredConfiguration").TriggerEvaluation($BaselineInfo.Name, $BaselineInfo.Version)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks again.
ASKER