R RJONA Active Member Messages 42 Solutions 1 Reaction score 4 Points 8 Apr 3, 2019 #1 Hey All, Well aware that I can Clear Required PXE Deployments from the console itself, But is there a way that I can clear it using a SQL Query?
Hey All, Well aware that I can Clear Required PXE Deployments from the console itself, But is there a way that I can clear it using a SQL Query?
Prajwal Desai Forum Owner Staff member Messages 5,009 Solutions 144 Reaction score 976 Points 413 Apr 8, 2019 #2 You may try this :- SQL: $Computer = "Server1" $ResourceIDQuery = Get-WmiObject -Namespace "ROOT\SMS\SITE_TRT" -class "SMS_R_System" -Filter "NAME='$Computer'" -ErrorAction STOP $Array = (,$ResourceIDQuery.ResourceID) Invoke-WmiMethod -Namespace "ROOT\SMS\SITE_TRT" -class "SMS_Collection" -name ClearLastNBSAdvForMachines -ArgumentList (,$Array) Upvote 0 Downvote
You may try this :- SQL: $Computer = "Server1" $ResourceIDQuery = Get-WmiObject -Namespace "ROOT\SMS\SITE_TRT" -class "SMS_R_System" -Filter "NAME='$Computer'" -ErrorAction STOP $Array = (,$ResourceIDQuery.ResourceID) Invoke-WmiMethod -Namespace "ROOT\SMS\SITE_TRT" -class "SMS_Collection" -name ClearLastNBSAdvForMachines -ArgumentList (,$Array)