Click to See Complete Forum and Search --> : VB Script to C#


Mushq
August 7th, 2008, 06:48 AM
Hi,
Can anyone please tell me how to convert following script into C# code.

strComputer = "atl-ws-01"
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")For Each objUser In objGroup.Members
If objUser.Name <> "Administrator" AND objUser.Name <> "Domain Admins"
Then
objGroup.Remove(objUser.AdsPath) End IfNext


Thanks,
Mushq

asSiDeluxE!
August 8th, 2008, 06:50 AM
There is no equivalent for GetObject() in C#.
Perhaps the links in the second post in this thread may help:

http://www.velocityreviews.com/forums/t82922-getobject-c-equevlent.html