KiXtart Login Assistance Best Practices and functionality questions
#21
Posted 10 April 2006 - 02:01 PM
IIRC, I tried @LDRIVE ( or was it @LSERVER ) but it was giving me problems. Permission problems I think. I ran it under the KixTart debugger and noticed that the return codes for WriteProfileString() was giving an access denied error. What I have written was the only way that I could get it to consistently work. Go figure...
As for @TICKS, most, if not all, of our computers get turned off every night.
-John
As for @TICKS, most, if not all, of our computers get turned off every night.
-John
#22
Posted 10 April 2006 - 02:12 PM
Sounds like someone doesn't have write perms to one, or all, of those LogonStatus$ shares on your DC's.
#23
Posted 10 April 2006 - 02:19 PM
That's what I'm saying....this should've worked:
Not that one way is more correct than the other...but that should work.
$REWT = "@LSERVER\LogonStatus$\@WKSTA.LOG"
Not that one way is more correct than the other...but that should work.
This post has been edited by nmX.Memnoch: 10 April 2006 - 02:20 PM
#24
Posted 10 April 2006 - 03:04 PM
Mordac85, on Apr 10 2006, 02:17 PM, said:
As a possible mod to nmX.Memnoch's code, you can also run it from your own system against selected systems in an IP range, domain, etc by throwing it into a loop. Which is probably what you want rather than put another item in your login script that may only hit a subset of your systems.
I got bored...
Modified from this example script (after fixing part of it).
Dim $Filter[0]
$Filter[0]="Computers"; Or replace "Computers" with "User" or "Group"
$ou = GetObject("LDAP://CN=users,DC=domainname,DC=com")
$ou.Filter = $Filter[0]
For Each $UserOrGroupOrComputer in $ou
$WK = "\\" + Trim(SubStr($UserOrGroupOrComputer.Name,4))
? "$WK"
If Exist("$WK\C$\")
" ONLINE"
$X = WriteValue("$WK\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","RunLogonScriptSync","1",REG_DWORD)
Select
Case @ERROR = 0
" UPDATED"
Case @ERROR > 0
" FAILED WITH @ERROR ERROR CODE"
EndSelect
EndIf
Next
Hmm...thought the CODE tags were supposed to keep things from wrapping?? Anyway, $X = WriteValue through REG_DWORD) should all be on one line.
This will provide the following type of console output for each computer:
\\computername ONLINE UPDATED
If the computer isn't online it'll just return the computer name.
Also, in case you don't read the notes on the original script I linked...
CN= should only be used on default AD containers. If you've made a seperate OU for your computers then you should use OU=. For example, if your domain name is domain.com and you're using the default Computers container then use:
CN=Computers,DC=domain,DC=com
But if you've made a new OU called Workstations (because some people like to keep their workstations, laptops, servers, etc, seperate) then you would use:
OU=Workstations,DC=domain,DC=com
This post has been edited by nmX.Memnoch: 10 April 2006 - 03:05 PM
#25
Posted 11 April 2006 - 08:13 AM
#26
Posted 11 April 2006 - 08:35 AM
#27
Posted 17 May 2006 - 06:03 AM
Hey Memnoch,
have you finished the script that checks computer group membership for mapping printers based on computer location?
Ricoh
have you finished the script that checks computer group membership for mapping printers based on computer location?
Ricoh



Help


Back to top









