1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

VBScripting problem....

Discussion in 'Legacy Windows' started by bday_bbs, 2004/05/14.

Thread Status:
Not open for further replies.
  1. 2004/05/14
    bday_bbs

    bday_bbs Inactive Thread Starter

    Joined:
    2003/10/06
    Messages:
    13
    Likes Received:
    0
    Okay... here's my problem. I'm using VBScript to view all
    currently locked accounts and trying to provide a button within an
    HTML page that allows for the unlocking of those accounts as well.
    However, I cannot seem to get the
    Win32_UserAccount properties right...and I've tried a lot of different
    settings. Just so you know, I'm still in an NT 4.0 server backbone
    using XP pro and WIndows 2000 on the desktop. I cant seem to get the
    "unlock" portion to work.

    This code works just fine until I get to the FOR loop.....



    <script type= "text/vbscript ">
    Function Un_Lock()
    strComputer = "[Domain_Controller] "
    Set objWMIService = GetObject( "winmgmts:\\" & strComputer &
    "\root\cimv2 ")
    Set colItems = objWMIService.ExecQuery( "Select * from
    Win32_UserAccount Where Lockout='true'and Name='[username]' ",,48)
    For each objItem in colItems
    objItem.Lockout = false
    objItem.setInfo
    document.write objItem.FullName& "<br> "&objItem.Name& "<br><br> "
    Next
    End Function
    </script>


    Any help would be appreciated....thanks.

    Bart
     
  2. 2004/05/27
    bday_bbs

    bday_bbs Inactive Thread Starter

    Joined:
    2003/10/06
    Messages:
    13
    Likes Received:
    0
    ...nevermind...

    Hey all, I was shown another way to go about doing this...

    Bart
     

  3. to hide this advert.

  4. 2004/05/28
    ReggieB

    ReggieB Inactive Alumni

    Joined:
    2004/05/12
    Messages:
    2,786
    Likes Received:
    2
    Does that mean you don't want to know that there should be a space between "'true'" and "and" in the Select statement?
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.