This VBS script can be used to delete a folder and all of its contents including any subfolders on a local machine. The script can be distributed as is or can be used in a group policy.
VBS Script:
strFolderName = "C:\Test"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(strFolderName) Then
fso.DeleteFolder strFolderName
End If
MsgBox "Done"
It is easy to get the PDC Role holder:
Set oSI = CreateObject("ADSystemInfo")
tArray = split(oSI.PDCRoleOwner,",CN=")
strPDC = tArray(1)
WScript.Echo strPDC
Pingback from fso