Danke für deine schnelle Antwort. Wollte dieses Script benützen
aber erhalte immer eine Fehlermeldung.
Hier mein Script:
Dim fso, f, Zeile, Feld
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile ("user2.txt",1,0)
Do while not f.AtEndOfLine
Zeile = f.readLine
Feld = split(Zeile,",")
Benutzer = Feld(0)
Vorname = Feld(1)
Nachname = Feld(2)
Passwort = Feld(3)
Mail = Feld(4)
Call BenuntzerAnlegen(Benutzer,Vorname,Nachname,Passwort,Mail)
Loop
f.Close
Wscript.Quit(0)
Sub BenuntzerAnlegen (Benutzer,Vorname,Nachname,Passwort,Mail)
Dim ouo, b
Set ouo = GetObject("LDAP://CN=Users,DC=itnetworx,DC=ch")
Set b = ouo.Create("user", "CN=" & Vorname & " " & Nachname)
Dim WshShell, ret
Set WshShell = WScript.CreateObject("WScript.Shell")
b.Put "sAMAccountName", Benutzer
b.Put "userPrincipalName", Benutzer & "@itnetworx.ch"
b.Put "mail", Mail & "@itnetworx.ch"
b.Put "profilePath", "\\itxerhf01\Daten\Test\profile\" & Benutzer
b.Put "homeDirectory", "\\itxerhf01\Daten\Test\home\" & Benutzer
b.Put "homeDrive", "U:"
b.SetInfo
'use CDOEXM to create mailbox, this is not possible with ADSI
'when using this script take care of the correct names !
Set objMailbox = b
objMailbox.CreateMailbox ("LDAP://itnetworx/CN=" + SG + ",CN=InformationStore,CN=itnetworx,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=itnetworx ASP,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=itnetworx,DC=ch")
'use IMailboxStore interface from CDOEXM to set Store Limits
objMailbox.EnableStoreDefaults = true
objMailbox.StoreQuota = 10000
objMailbox.OverQuotaLimit = 12000
objMailbox.HardLimit = 15000
' set password and enable account
b.SetPassword Passwort
b.AccountDisabled = true
b.SetInfo
WScript.Sleep(1000)
ret = WshShell.Run ("verz.cmd " & Benutzer,0,1)
End Sub
Fehlermeldung.
Line 36, Char 1, Invalid Argument, ID no: c103071f Microsoft CDO Exchange Management
Ich weiss einfach nicht mehr weiter. Bitte um Hilfe. Besten Dank
Singe