Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hiiiillfe!!! --- LOGINHOURS in vbs

Empfohlene Antworten

Veröffentlicht

Hallo ich habe ein Problem.

Ich muss einien Win2000 Server als Domänencontroller erstellen. und ich möchte für einige bestimmte user ein vbscipt schreiben. das hab ich auch schon. Das script legt im grunde genommen nur die user an. doch die user dürfen sich nur zu einer bestimmten zeit einloggen. das geht ja ganz leicht im active directory einzustellen, aber wenn ich das für jeden user mache, den ich neu anlege (und das sind nicht wenige), dann wird das irgendwann lästig. Also will ich das mit in das script einbauen.

ich habe zwar schon einiges darüber gefunden, z.b., dass es loginhours heißt, aber ich finde nirgendwo ein beispiel, wie man die tage und stunden da eingibt.

das geht mit adsi, aber wie?

könnt ihr mir helfen? ich muss das bis allerspätestens übermorgen fertig haben und ich verzweifle langsam daran.

bitte HELFT mir.

mfg Schnagels

siehe http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/iadsuser_property_methods.asp - dort unter LoginHours nachschlagen.

wie das ganze in kleinere zeiteinheiten aufgesplittet werden kann, zeigt dieser artikel.

To work with the byte array, you need to understand its structure. A quick reminder is that a byte is 8 bits, and a bit is a 1/0 value. A byte value is often displayed to users as a HEX or decimal value, but the computer sees it as the binary values (11111111, 10101010, 00000000, etc.). The LoginHours array has a total of 21 elements, where each element represents an 8 hour block of time (1 week = 168 hours, 168 hours / 8bits per byte = 21 elements).

eine ähnliche aufgabenstellung von dir vermittels ADSI war diese, hat dir da die MSDN helfen können?

s'Amstel

erst mal danke ich werdes versuchen und wenns nicht klappt, dann meld ich mich.

und zu dem anderen thema hab ich im msdn nichts gefunden (keine ahnung warum, denn eigentlich sollte es drin stehen), aber ich habe von einem Freund einen Tipp bekommen, wie das funktioniert und dann lief es.

so ich habe mir das durchgelesen und auch alles verstanden.

dann habe ich auf der seite mal nen link geklickt und von dort aus zu einer anderen seite. dort stand folgender quelltext: (ich schreib jetzt mal nur den teil mit loginhours)



'VBScript doesn't use byte arrays, and the LoginHours property does.

'You have to kluge around a bit to get it to work.  This example was lifted

'directly from: Michael Harris \Microsoft.MVP.Scripting \ Seattle

'http://groups-beta.google.com/group/microsoft.public.scripting.wsh/browse_thread/thread/17859143dab3004d/afd80e5934815e5e


Dim fso, stream, temp, ts, LoginHours

Set fso = CreateObject("scripting.filesy*stemobject") 

Set stream = CreateObject("adodb.stream") 


temp = fso.gettempname() 

Set ts = fso.createtextfile(temp) 


'LoginHours is 21 bytes with the 1st being 

'Saturday 3rd shift... 

' 

'1st shift is 12:00am - 7:59am 

'2nd shift is  8:00am - 3:59pm

'3rd shift is  4:00pm - 11:59pm 

' 

ts.write Chr(&h00) 'sa_3 

ts.write Chr(&h00) 'su_1 

ts.write Chr(&h00) 'su_2 

ts.write Chr(&h00) 'su_3 

ts.write Chr(&hff) 'mo_1 

ts.write Chr(&hff) 'mo_2 

ts.write Chr(&hff) 'mo_3 

ts.write Chr(&hff) 'tu_1 

ts.write Chr(&hff) 'tu_2 

ts.write Chr(&hff) 'tu_3 

ts.write Chr(&hff) 'we_1 

ts.write Chr(&hff) 'we_2 

ts.write Chr(&hff) 'we_3 

ts.write Chr(&hff) 'th_1 

ts.write Chr(&hff) 'th_2 

ts.write Chr(&hff) 'th_3 

ts.write Chr(&hff) 'fr_1 

ts.write Chr(&hff) 'fr_2 

ts.write Chr(&hff) 'fr_3 

ts.write Chr(&h00) 'sa_1 

ts.write Chr(&h00) 'sa_2 


ts.close 


stream.type = 1 

stream.open 

stream.loadfromfile temp 


LoginHours = stream.read 


stream.close 

fso.deletefile temp


objUser.Put "loginHours", LoginHours

objUser.SetInfo


Das habe ich von der Internetseite: http://www.dx21.com/SCRIPTING/ADSI/ADGUI/USER3.ASP

Da könnt ihr euch auch mal ruhig den ganzen quellltext ansehen. es ist der ganz unten.

doch leider funzt das nicht. ich weiß nicht warum.

ok dann sag du mir bitte genau wo ich das bei windows 2000 server im active directory machen kann. denn ich hab dort noch nichts gefunden. wenn du was darüber weißt schreib bitte mal den genauen weg dort hin. aber bitte schnell. Danke.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.