CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: VB Script to C#

  1. #1
    Join Date
    Feb 2007
    Posts
    119

    Question VB Script to C#

    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

  2. #2

    Cool Re: VB Script to C#

    There is no equivalent for GetObject() in C#.
    Perhaps the links in the second post in this thread may help:

    http://www.velocityreviews.com/forum...equevlent.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured