Jump to content

nmX.Memnoch

Patron
  • Posts

    2,084
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Everything posted by nmX.Memnoch

  1. You won't notice any real-world difference in performance.
  2. 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
  3. That's what I'm saying....this should've worked: $REWT = "@LSERVER\LogonStatus$\@WKSTA.LOG" Not that one way is more correct than the other...but that should work.
  4. Actually, it resets after 25 days. So your math will most likely result in a negative numer, not that @TICKS is counting backwards. I can't verify what the actual number was after 25 days because our SMS guys did an "inadvertant" push the other day that rebooted all my servers. Yeah...don't get me started... I keep forgetting to check for UDFs...hehe. Using a command line util isn't much of a concern...what I'm working on now is a daily output script that will email relavent information about my servers to me each night. I always do prefer doing WMI calls where I can though because they're much faster. Thanks for the linkage.
  5. Thanks for posting that. I found it the other day when it was brought up, but I didn't bother posting it because most people here have access to their GPO's. I don't... If you need it...here's some quick code to add it to your script: If InGroup("@WKSTA\Administrators") $X = WriteValue("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","RunLogonScriptSync","1",REG_DWORD) EndIf That's a simple fix well documented on the Kix forums. All you need to do is assign your statement to a variable to eliminate the echo to STDOUT like so: ; Set IE home page $ = WriteValue($IEmain,"Start Page",$IEhome,"REG_SZ") I've always heard it was Bad WooJoo to use just a $ for a variable. I prefer to use $X just in case. Not a bad editor for free. It reminds me a lot of the old KiXscripts Editor. My preference is AdminScriptEditor (which is the new updated version of KiXscripts Editor with support for more languages). PrimalScript is also decent, but costs more. I prefer the way ASE color codes KiX to the way PrimalScript does it.
  6. Modify it as such: ; Read the value for the default printer $DefPrn = ReadValue("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device") ; If HR01 is mapped on the current print server, remap it to the new print server If KeyExist("HKCU\Printers\Connections\,,CURRENT_SERVER,HR01 (HP 8100DTN)") $X = DelPrinterConnection("\\CURRENT_SERVER,HR01 (HP 8100DTN)") If @ERROR > 0 ? "Old printer connection 'HR01' was NOT deleted successfully" EndIf $X = AddPrinterConnection("\\NEW_SERVER\HR01") If @ERROR > 0 ? "New printer connection 'HR01' was NOT added successfully" EndIf ; If HR01 was the default printer, reset it as the default printer If InStr($DefPrn,"\\CURRENT_SERVER\HR01 (HP 8100DTN)") $X = SetDefaultPrinter("\\NEW_SERVER\HR01 (HP 8100DTN)") If @ERROR > 0 ? "Printer 'HR01' was NOT reset as the default printer" EndIf EndIf EndIf ; If LAB01 is mapped on the current print server, remap it to the new print server If KeyExist("HKCU\Printers\Connections\,,CURRENT_SERVER,LAB01 (HP 4250DN)") $X = DelPrinterConnection("\\CURRENT_SERVER,LAB01 (HP 4250DN)") If $X > 0 ? "Old printer connection 'LAB01' was NOT deleted successfully" EndIf $X = AddPrinterConnection("\\NEW_SERVER\LAB02") If $X > 0 ? "New printer connection 'LAB02' was NOT added successfully" EndIf ; If LAB01 was the default printer, reset it as the default printer If InStr($DefPrn,"\\CURRENT_SERVER\LAB01 (HP 4250DN)") $X = SetDefaultPrinter("\\NEW_SERVER\LAB02 (HP 4250DN)") If $X > 0 ? "Printer 'LAB02' was NOT reset as the default printer" EndIf EndIf EndIf Basically you're using the "$X = " part to "trap" the @ERROR return code, which it from being displayed in the console. The value of $X will be the return code (@ERROR) of the operation. Anything greater than 0 (for these particular commands) is a failure. The NETLOGON share is also replicated to each DC. In the case where you're calling items from the NETLOGON share then you should be using the @LDRIVE variable (or @LSERVER variable if you're referencing a common share on each DC). However, when mapping shares that aren't on the domain controller(s) then you have no choice but to use the server name. Most people don't run file and print services on their domain controllers. BTW, just so you know, @TICKS has problems. Once you get past a certain number of days it'll start counting backwards. I prefer to use a command line utility to write the information to a text file and then parse the information from there. For example...using the built in systeminfo command: Shell '%COMSPEC% /C systeminfo > "%USERPROFILE%\sysinfo.txt"' If Open(1,"%USERPROFILE%\sysinfo.txt",2) = 0 $LINE = ReadLine(1) While @ERROR = 0 If InStr($LINE,"System Up Time") $UPTIME = Trim(SubStr($LINE,28)) EndIf $LINE = ReadLine(1) Loop EndIf Del "%USERPROFILE%\sysinfo.txt" It'll take a little longer to run because systeminfo parses quite a bit of information. There's a utility in the resource kit called uptime.exe that runs pretty quick. I use systeminfo because it has lots of other information I need at the same time so I can do it with just one dump (and it's not something that we're running in our logon script).
  7. This is why I don't like resizing partitions... If you can manage to just delete any partitions on the drive and reformat it (with quick format), then you can use RecoverMyFiles. http://www.recovermyfiles.com/ Just don't write anything to the drive before running that, and be sure to do your recovery to a different drive.
  8. You can still connect to a server running FrontPage Server Extensions from an XP Home machine. Connecting to an FPSE enabled server is a function of FrontPage itself, not the OS. Among other things, FPSE allows you to connect directly to the web server to upload/edit files without having to use an FTP client (or even have FTP enabled on the server).
  9. Here we go with the FAT32 vs. NTFS argument again... Don't make Granny an Admin on her machine and it will most certainly keep out viruses and spyware. Why? Because under the default NTFS security permissions malware won't have access to write to the areas where it really matters (%SYSTEMROOT%, %PROGRAMFILES%, HKLM registry hive, etc). Hackers are kept out by completely different methods. However, proper NTFS permissions will make it much more difficult for them to gain access to information should they get in. Your security chain is only as good as the weakest link...
  10. To be honest you're spending more time figuring out how to do an upgrade install from XP to Server 2003 than you would if you just did a fresh install of Server 2003 and reconfigured the FAX services. Between the time you posted the original message and the time you replied to cluberti (over 12 hours), you could've had the entire thing reinstalled and reconfigured.
  11. That's fine for their home drive...and that's the way it should be done. I use the individual part if there's a share specifically for something that only one or two users require access to it. BTW, you can use local groups, or server-side groups for the InGroup check, it doesn't have to be a domain group. If InGroup("@WKSTA\Administrators") or If InGroup("\\SERVER\group") I would love to see this. I did this once before in an old company, but all I had to do was populate a file called printers.ini. I ended up doing this for the server check, thanks to some help from the KixTart forum: It's actually quite simple once you get into it. Everything is done with registry checks to see what they currently have set as a default printer, and then what printers they are currently mapping. The script will automatically remap any currently connected printers from the current server to the new server, and then reset the default printer if necessary. The following code assumes the printer names and share names will stay the same...you're just migrating them from one server to another. If you're renaming the full name or the share name all you have to do is match up the old name with the new name. Printer 1 = HP LaserJet 8100DTN with a full name of "HR01 (HP 8100DTN)" and a shared name of "HR01" on the current server. Printer name staying the same on the new server. Printer 2 = HP LaserJet 4250DN with a full name of "LAB01 (HP 4250DN)" and a shared name of "LAB01" on the current server. Printer being renamed on the new server to a full name of "LAB02 (HP 4250DN") and a shared name of "LAB02". ; Read the value for the default printer $DefPrn = ReadValue("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device") ; If HR01 is mapped on the current print server, remap it to the new print server If KeyExist("HKCU\Printers\Connections\,,CURRENT_SERVER,HR01 (HP 8100DTN)") DelPrinterConnection("\\CURRENT_SERVER,HR01 (HP 8100DTN)") AddPrinterConnection("\\NEW_SERVER\HR01") ; If HR01 was the default printer, reset it as the default printer If InStr($DefPrn,"\\CURRENT_SERVER\HR01 (HP 8100DTN)") SetDefaultPrinter("\\NEW_SERVER\HR01 (HP 8100DTN)") EndIf EndIf ; If LAB01 is mapped on the current print server, remap it to the new print server If KeyExist("HKCU\Printers\Connections\,,CURRENT_SERVER,LAB01 (HP 4250DN)") DelPrinterConnection("\\CURRENT_SERVER,LAB01 (HP 4250DN)") AddPrinterConnection("\\NEW_SERVER\LAB02") ; If LAB01 was the default printer, reset it as the default printer If InStr($DefPrn,"\\CURRENT_SERVER\LAB01 (HP 4250DN)") SetDefaultPrinter("\\NEW_SERVER\LAB02 (HP 4250DN)") EndIf EndIf The code I posted is exactly the opposite of that. It checks to see if you're logging onto a Member Server or Domain Controller, instead of checking to see if you're logging onto a workstation. I find that a direct check instead of an indirect (NOT) check usually works better. Keep in mind that since you have direct access to your group policy settings you can do a lot of this in a GPO. I don't have direct access to the group policy settings for my users (I'm not a domain admin, but I am an admin for one of the organizations on base). I have to get a little more creative when I want to force settings. I do Trusted Sites settings on our logon script as well...but again, you could do this in a GPO. Yep, that's in seconds. 300 seconds is 5 minutes. We're required to have our screensavers set to between 5 and 20 minutes. We're a Customer Service oriented organization and most of our workstations are in high-traffic areas so we went with 5 minutes. This is another setting you could force via Group Policy. Sure thing! With some things it's just a personal preference. KiX was originally designed from the ground up for logon script usage. For a long time it was the only real alternative to CMD. It's grown since then so that you can use it for lots of other things. For the longest time it was the only real option if you wanted real logon scripts so a lot of people were using it. KiX also has a lot of built-in functionality for doing things such as reading registry values, connecting printers, mapping drives, etc. I know VBScript has these same things, but sometimes it takes less code to do it in KiX. Just for instance: wscript.echo "Thanks" vs. ? "Thanks" To do the same exact thing. KiX can also do most of the same COM automations calls that VBScript can do. KiX can do WMI calls/reads, read/write text files, Excel Spreadsheets, Access DBs, SQL DBs, etc, etc.
  12. This sounds like you're having a problem with the router, and not the machine. Is there more than one machine connected to the router?
  13. The RAID configuration is stored on both the drives and the controller. This is why if you disconnect one or more drives the controller will tell you that the RAID has failed. With IDE/SATA RAID setups if you reconfigure it the same way (same RAID mode, same stripe size, etc) then you shouldn't lose any data. However, it's always best to have a good backup "just in case". With SCSI setups things are a little easier because it'll ask which is the current configuration...what's in NVRAM or what's configured on the drives. Obviously in this type of situation you'd want to choose the drive configuration...which would then be cased into the SCSI RAID controller's NVRAM.
  14. Are you able to successfully connect to the site with FrontPage? In FrontPage click on File and choose Open Site. Now type in the URL to your site and click on OK. Once you do that you should be able to drag and drop the files from Windows Explorer onto your site in FrontPage. From here on you just connect directly to the site to update pages (as opposed to updating them on your machine and then uploading). Not true.
  15. I got a reply coming to this but I had to leave work early today. I'll post a more detailed reply tomorrow when I have time to gather my thoughts again. The original reply wouldn't have had the printer migration example code anyway...
  16. Not if you do it with GPO as a machine startup script.
  17. Search is your friend. From this thread:
  18. KiX is awesome. I use it for a lot of things, not just logon scripts. I even use it extensively on my Unattended XP CD. Going back to logon scripts...I have another one I'm working on that uses a UDF (created by someone else) that checks computer group membership. This will be used for mapping printers based on computer location (computer groups will be specific to the bldg and room number).
  19. I knew about the syncronous/asyncronous settings but I wasn't sure if that applied to "normal" logon scripts as opposed to those specified in GPO (machine startup/shutdown scripts and user logon/logoff scripts). I got to looking at my script and cleaning it up will just remove too much of the useful information. I work on a USAF base so I can't just post the information. I can, however, help you with parts of yours. If you tell me what you're trying to do I can help. I did notice a few things in your script that can be done in much less code, namely your server check. Try this: ; ---------------------------------------------------------------- ; Server Check Code (Do not run script if logging onto server) If InStr(@PRODUCTTYPE,"Server") Or InStr(@PRODUCTTYPE,"Domain Controller") Use X: "\\SERVER\Share1" Use Y: "\\SERVER\Share2" "Logged onto a server, skipping 12 CPTS script..." Goto end EndIf User groups can be done in several ways. We have one group that contains all of our users within our organization (for you this would be your Domain Users group). Then we have individual groups for the different work centers. Each person is only a member of one work center group so we use Select Case statements for that. You could use If EndIf statements, but Select Case EndSelect statements are faster because it terminates once the value is true. With an If EndIf statement it'll check the users group membership each time. We use the All Users group for common drives and settings: If InGroup("All Users") Use G: "\\SERVER\Share1" Use N: "\\SERVER\Share2" $Value = WriteValue("HKCU\Control Panel\Desktop","ScreenSaveActive","1",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Desktop","ScreenSaverIsSecure","1",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Desktop","ScreenSaveTimeOut","300",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Desktop","SCRNSAVE.EXE","ssmarque.scr",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Screen Saver.Marquee","BackgroundColor","0 10 101",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Screen Saver.Marquee","CharSet","0",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Screen Saver.Marquee","Font","Arial Narrow",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Screen Saver.Marquee","Mode","1",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Screen Saver.Marquee","Size","27",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Screen Saver.Marquee","Speed","2",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Screen Saver.Marquee","Text","marquee text",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Screen Saver.Marquee","TextColor","255 255 0",REG_SZ) $Value = WriteValue("HKCU\Control Panel\Screen Saver.Marquee","Attributes","00001",REG_SZ) If InStr(@ProductType,"XP Professional") And @CSD = "Service Pack 2" ? "Windows XP Professional Service Pack 2 Detected" ? "--Adding Allowed Popup Sites" $Value = WriteValue("HKCU\SOFTWARE\Microsoft\Internet Explorer\New Windows","PlaySound","1",REG_DWORD) $Value = WriteValue("HKCU\SOFTWARE\Microsoft\Internet Explorer\New Windows","PopupMgr","yes",REG_SZ) $Value = WriteValue("HKCU\SOFTWARE\Microsoft\Internet Explorer\New Windows\Allow","*.af.mil","",REG_BINARY) $Value = WriteValue("HKCU\SOFTWARE\Microsoft\Internet Explorer\New Windows\Allow","*.dod.mil","",REG_BINARY) $Value = WriteValue("HKCU\SOFTWARE\Microsoft\Internet Explorer\New Windows\Allow","*.disa.mil","",REG_BINARY) $Value = WriteValue("HKCU\SOFTWARE\Microsoft\Internet Explorer\New Windows\Allow","*.dla.mil","",REG_BINARY) $Value = WriteValue("HKCU\SOFTWARE\Microsoft\Internet Explorer\New Windows\Allow","*.microsoft.com","",REG_BINARY) EndIf EndIf Now for individual groups you would do something like this: Select Case InGroup("Group1") Use O: "\\SERVER\Group1Share1" Use T: "\\SERVER\Group1Share2" Case InGroup("Group2") Use O: "\\SERVER\Group2Share1" Use T: "\\SERVER\Group2Share2" Case InGroup("Group3") Use O: "\\SERVER\Group3Share1" Use T: "\\SERVER\Group3Share2" Case InGroup("Group4") Use O: "\\SERVER\Group4Share1" Use T: "\\SERVER\Group4Share2" EndSelect Select Case EndSelect statements work like this...if a user is logging on who is a member of Group 2 then the Select statement would parse the first Case statement to see if they're a member of Group1. When it sees they're not, it'll move onto the next Case statement. It sees they're a member of Group2 so it executes the commands for Group2 and then terminates the Select Case EndSelect statement. Again, this only works if your users are only members of one work center group. And you'll obviously want to prioritize your groups (the ones with the most members should be first). You can also do shares specific to individual users with Select Case EndSelect statements: Select Case @USERID = "User1" Use T: "\\SERVER\User1Share" Case @USERID = "User2" Use T: "\\SERVER\User2Share" Case @USERID = "User3" Use T: "\\SERVER\User3Share" Case @USERID = "User4" Use T: "\\SERVER\User4Share" I have a print server migration script that I used a while back...let me dig that up and I'll post it as well. Done correctly it'll even reset the user's default printer...the move will be completely transparent.
  20. It doesn't have any HTML files because it's a Sharepoint site. What happens when you try to ping companyweb in a Command Prompt? Does it resolve?
  21. Finally...someone else who uses KiX... Change this to just: login.bat This is good. It's not necessary to copy the executable to every workstation unless you have Win9x clients...then they'll need the associated DLLs as well. Shouldn't be an issue these days though. It also helps to ensure that everyone is using the same version of KiX and gives you only one location to update the executable at when new versions come out. Add the following as the very first lines of your KiX script. It'll set the console height to 15 lines and then maximize the console window so you can see what it says. Shell "%COMSPEC% /C mode con lines=15" CLS $Console = SetConsole(MAXIMIZE) CLS I'm not sure that this can be done. I'll research this tomorrow at work since I have the better editor* installed on that machine. You want a consent statement. Try this: $Consent = MessageBox("blah blah blah message content here blah blah blah","message title here",4116) If $Consent = 7 ? "No Selected, Logging Off" Logoff(1) EndIf 4116 is the sum of selecting 4, 16, 0 and 4096 from the following options: 7 is the return value if they choose No: *Now...on to editors. There are a few editors (besides Notepad, of course) that correctly color-code KiX code. My personal favorite is AdminScriptEditor. It also does VBS, BAT, CMD, XML, etc, etc...but it's original name was KiXScripts Editor so it's roots are in KiX. This is the one I have installed at work and use the most. PrimalScript 4.0 from SAPIEN is another good editor, I just don't like they way they color code KiX. It's also more expensive than AdminScriptEditor. Also, another thing I do is keep an Excel spreadsheet with script history. Basically it has what was changed, when it was change and who changed it. This way we can keep track of what was done if something breaks. If you want, I can post a cleaned up copy of my logon script. Some things my script does are: Checks C: drive space, emails admins if less than 1GB free Checks SAV definitions, emails admins if older than 14 days Checks SAV version, emails admins if incorrect version installed Maps drives common to each work area Maps drives specific to an individual or individuals Forces screensaver settings. Screensaver tab is hidden through group policy. Using the script allows me to easily change it (we don't have direct access to our GPO settings). Sets popup blocker settings for IE6 SP2 (sets popup blocker to High and sets allowed sites) Adds certain sites to the Trusted IE Zone (mainly required for an intranet site that uses FQDN so user credentials are automatically passed through) Enforces certain security settings on the workstation when an admin logs on There are a few other items that I can't remember right now...but that's a quick list.
  22. You'll pay a premium for those motherboards though...and rightly so. They use software. Given the choice I'd opt for an older Live! card just to offload sound processing from the CPU.
  23. Yes, it is. You only need it when you have the SATA controller built into the southbridge running in RAID mode. Can't remove it because it's built into the motherboard.Either the SATA controller built into the motherboard is going bad or there is another piece of hardware conflicting with it. I'd take the original suggestion of removing everything you don't need to boot the system (sound, LAN, all but one stick of RAM, etc). If it boots then the culprit is one of the items you removed.
  24. Hehe...leave it to cluberti to have the officially supported method...
  25. SoundStorm was the onboard audio for nForce and nForce2 based motherboards. It's one of the few hardware based onboard audio solutions there was...and it had support for Dobly Digital encoding in hardware. They dropped it after the nForce2 though... http://www.nvidia.com/object/feature_soundstorm.html
×
×
  • Create New...