Re: ldap with nt4
From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 01/25/05
- Next message: Sandra: "Re: WMI script to obtain software ProductID for Win2000 and higher"
- Previous message: Torgeir Bakken \(MVP\): "Re: size and location"
- In reply to: cornerman: "ldap with nt4"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 25 Jan 2005 16:59:26 +0100
cornerman wrote:
> I have see a script dat sets a password for a user but i see
> ldap how can i use ldap with nt4???
Hi
You can't use LDAP in a NT4 domain, but you can use the WinNT
provider to do this:
'--------------------8<----------------------
Set oWshNet = CreateObject("WScript.Network")
strName = "user logon name here"
' If the computers are in another domain than the user you
' want to change, you will need to hard code the domain name
' the user belongs to in the variable "strNetBIOSDomain".
strNetBIOSDomain = oWshNet.UserDomain
On Error Resume Next
Set objUser = GetObject("WinNT://" & strNetBIOSDomain & "/" _
& strName & ",user")
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "User " & strName & " NOT found"
Else
objUser.SetPassword strName
objUser.SetInfo
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "Password NOT set for " & strName
Else
Wscript.Echo "Password set for " & strName
End If
End If
'--------------------8<----------------------
-- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter/default.mspx
- Next message: Sandra: "Re: WMI script to obtain software ProductID for Win2000 and higher"
- Previous message: Torgeir Bakken \(MVP\): "Re: size and location"
- In reply to: cornerman: "ldap with nt4"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|