Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING SCCM Clients Software Updates Scan error

venkateshcme_81

Active Member
Messages
28
Reaction score
0
Points
1
we have 1000+ Systems sys where we have windows update issue where we need to delete .pol file and perform gp update /force to get the updates its simple and working when did manually
but when trying to run the same with scripts Via package (.bat or .cmd or .ps1) to rename or delete the POL its not at all happening
can any one help me wit the working script (to del or rename .pol file and update gpupdate /force) or any way - to resolve the issue

thanks in advance
 
You can create a text file and add the computers in the file.

Then use the below script to delete the registry.pol

Code:
$computers=Get-Content c:\temp\computers.txt
foreach($computer in $computers)
{
  Invoke-Command -ComputerName $computer -ScriptBlock {Remove-Item -Path “C:\Windows\System32\GroupPolicy\Machine\Registry.pol” -Force }
}
 
created a Folder which contains 2 files- folder in sccm server only
script.txt - script you have give
computers.txt - with computers names

shell i make it a vbscript or PS script? and shell i directly run the script file from the same folder and server right
we do not have to create a package or application right.

1615388049663.png
sorry to kill your time
thank you so much for the support
 

Forum statistics

Threads
7,078
Messages
27,650
Members
17,904
Latest member
ScottBlake
Back
Top