singe
-
Gesamte Inhalte
4 -
Registriert seit
-
Letzter Besuch
Beiträge erstellt von singe
-
-
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
-
Hallo zusammen
Ich habe folgendes Problem. Ich möchte mit vb Script auf meinem Exchange Server 2003 Postfächer anlegen. Kann mir jemand helfen. Wäre euch sehr dankbar.
Liebe Grüsse
Singe
-
Hallo zusammen super script konnte das heute wunderbar anwenden um 240 Benützer auf meinem Exchange anzulegen danke vielmals. Hat mir sehr viel arbeit erspart!
Jetzt habe ich eine weiter Frage: Wie kann ich die Mailboxen für den Exchange 2003 Server im gleichen Script mit aktivieren?
Hier mien Script in leicht abgeänderter Form.
Mein Code:
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
Set objMailbox = b
objMailbox.CreateMailbox ("LDAP://MyNet-BE/CN=" + SG + ",CN=InformationStore,CN=MyNet-BE,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=MyNet ASP,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=MyNet,DC=com")
objMailbox.EnableStoreDefaults = true
objMailbox.StoreQuota = 10000
objMailbox.OverQuotaLimit = 12000
objMailbox.HardLimit = 15000
b.SetPassword Passwort
b.AccountDisabled = False
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, Code 80070057
Habe keine Schimmer wie ich das anstellen kann. Für Eure Hilfe wäre ich Euch sehr dankbar.
Gruss
Singe
Posfach mit Script anlegen
in Windows Server Forum
Geschrieben
Hallo hab es mit dem Script probiert das du mir per link gschickt hast.
Mein Code:
org="itnetworx.ch"
SG="Postfachspeicher(itxerhf01),CN=Erste Speichergruppe"
' bind to container, create user and set some (basic) settings
Set ou = GetObject("LDAP://OU=" + org + ", DC=itnetworx, DC=ch")
Set usr = ou.Create("user", "cn=JSmith")
usr.Put "samAccountName", "jsmith"
usr.givenName = "John"
usr.sn = "Smith"
usr.displayName = "John Smith"
usr.userPrincipalName = jsmith
usr.mail = JSmith
usr.SetInfo
'use CDOEXM to create mailbox, this is not possible with ADSI
'when using this script take care of the correct names !
Set objMailbox = usr
objMailbox.CreateMailbox ("LDAP://itxerhf01/CN=" + SG + ",CN=InformationStore,CN=itxerhf01,CN=Servers,Erste Administrative Gruppe,CN=Administrative Groups,CN=itnetworx,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=itnetworx,DC=ch")
'use IMailboxStore interface from CDOEXM to set Store Limits
objMailbox.EnableStoreDefaults = FALSE
objMailbox.StoreQuota = 10000
objMailbox.OverQuotaLimit = 12000
objMailbox.HardLimit = 15000
' set password and enable account
usr.setPassword "password"
usr.AccountDisabled = False
usr.SetInfo
wscript.echo "Finished!"
Jetzt erhalte ich die Fehlermeldung:
Line 6. Char 1,,, Ther is no such object on the server, Code 80072030
Besten Dank für Eure Hilfe
Lieber Gruss
Singe