Tag Info

Hot answers tagged

17

As part of our logon script I have that information (and more) logged into a hidden share on a server, with one log file per user. A logoff scripts adds the time the user logged off to the same log file. Easy to set up, no cost and the information is there in an easy to read format.


8

We do this via logon script which updates the computer object's description in AD. You need to perform a custom delegation of control to allow "Authenticated Users" to write the description property of computer objects in the domain/s. Once that's done, all you need is a script that generates whatever information you want and writes the properties to the ...


8

On a non domain machine you can edit the local machine policy to run scripts at startup and shut down (this may not work in Vista Home edition). To access this go to start, run then enter gpedit.msc. In here, expand the user configuration node, then windows settings, then you will find a scripts option where you can set the location of scripts to be run at ...


6

It would be much easier if you used Group Policy Preferences to map the drives and did item-level targeting to filter drive maps by group. This is the preferred way.


5

I might get down voted for this, but so be it. I've always considered logon scripts to be kind of hack'ish and try to only use them as a last resort. There are so many ways to manage systems and users these days with things like Group Policy, Group Policy Preferences, and SCCM/SMS. I mean, there's always going to be cases where there just isn't a better ...


5

You can enable auditing for account logon events. These events (including workstation unlock) will be stored in the DC's security log. There are also third party tools that can make this easier, such as True Last Logon.


5

Logon scripts don't display a command prompt window whilst they are running by default, however it is possible to enable this behaviour via a GPO. The logon scripts will run whilst the explorer shell is loading. You can test the exact timing of this by adding the following to one of your scripts, which will record the time the script is run in a log file. ...


5

You could use something like the following. It reads the registry key for PowerShell. If the read is successful (return code 0), or not, you get the corresponding message box, which you can switch out for other logic you need to do--like install PowerShell if it's not detected. See the source links below for more info. Option Explicit Dim oShell Dim value ...


5

Using a User Logon Script policy will always run the script as the user. There's no getting around that. As an alternative, you could consider using a Computer Startup Script. These are excecuted as the Local System account, which will have privs roughly equivilent to a local administrator account.


5

I perfer using group policy preferences for drive and printer mapping, but it really is just the preference of the person that has to manage it. Both scripts and GPO works fine and can generally give you the same results, but GPO preference I find easier to add criteria and troubleshoot.


5

for /f is your friend. for /f "usebackq tokens=1,2,3 delims=:" %A in (`ipconfig ^| Find "Default Gateway" ^| Findstr/N "." ^| Findstr/B "1:"`) do @if not defined MYVAR set MYVAR=%~C ...might do the trick. Edit: changed the code block to read the third value not the second, and needed to escape the pipes. You could also shorten to: for /f "usebackq ...


4

I just write the user name (as well as other info, like date and time, some program versions and so on) into the computer description using a logon script. That way I can pull all the info from AD Users & Computers quickly and easily, and as a bonus have a good way of identifying which PCs still in AD haven't been used in a while (and are therefore most ...


4

Use the runas command. or In Windows Explorer you can right-click on the bat file and choose Run As... then enter your credentials. or You could run it from a scheduled task which lets you set credentials.


3

You have two options. One means you'll have to manually pass the password each time (not ideal), the other will let you pass with password from the batch file (but this means anyone can read the batch file and discover the password). You choose which flaw you would rather live with: Option 1 (Manual Password Entry) rem This is the test.bat file runas ...


3

Although we use powershell on our servers, we use vbscript on the clients to login. VBscript is installed by default and we use it instead of CMD batch files because of the access to wmi and specifically we use it to install all the appropriate printers.


3

Here's one of my favorites. We've got 700+ users and various divisions and subgroups that require their own drives. We're mapping based on username currently: if %username% == [username] net use /delete Z:\ if %username% == [username] net use Z: \servername\share another is the mapping of homedrives: net use H: \homeserver\%username% ...


3

ShellExecute the URL.


3

Why do this with batch file gyrations when you can just link GPOs to site objects? The "bonus" being that if you add addt'l subnets or move subnets around you'll never have to edit your script. If you're looking at this being a user logon script that you want to apply only when users logon to specific computers then you'll need to look at using loopback ...


3

There are lots of ways to skin this. For part 2, I have a vbscript that queries group membership and returns an errorlevel that you can use in your batch. The same could be done with powershell. Here is the vbscript: 'On Error Resume Next ' GroupCheck - GjM - returns errorlevel 1 if user is member of group, else returns 0 ' EX: groupcheck.vbs ...


3

It depends on the client OS. I've run into a lot of issues using the native drive and printer map Group Policy functions on XP clients. They just don't seem to work quite right, and the only thing worse than getting a couple "my filez is gone, halp!!!!" tickets every day is getting 300 one morning because that GPO inexplicably decided to not show up for ...


2

If it is only for yourself, or you are not worried about users removing it, you could just create a shortcut to the website on the desktop like any other shortcut then move the shortcut to the start menu in All Program > Startup. For all users just drop it in \Documents and Settings\All Users\Start Menu\Programs\Startup, or for a specific user drop it in ...


2

Windows Vista's Task Scheduler also supports running scripts at those events. http://technet.microsoft.com/en-us/appcompat/aa906020.aspx


2

The trick to knowing for certain where users last logged in aside from suggestions from Adam is log aggregation. If you have multiple domain controllers you either have to check them all, or centralize your logging and then check the single log. Some, maybe even most, third party tools are smart enough to query all the domain controllers. But if you're ...


2

I had to achieve the same result for similar reasons; somehow determine which machine a specific user logged in from. I wanted to know "before the fact", and couldn't change user login scripts as discussed above. I used powershell on the DC that the user was authenticating against to parse the Security event log: get-eventlog "Security" | where {$_.Message ...


2

Sounds like a cahced credentials/cached profile problem. Try picking on one user (preferably someone this won't impact too much on), deleting their local profile on their PC, and getting them to log on again. If that works then you may need to either instruct users to do a gpupdate /force or to log off and back on up to 3 times before it will kick in. If ...


2

It sounds like you don't know if the users are executing the new version of the script or the old version. (I'm guessing that you have a single domain controller and that this isn't a file replication issue between the DCs. Theoretically, it could be, but we'll go there only if you indicate that you're seeing replication problems with the NETLOGON share ...


2

I would use group policy preferences to map drives in AD. See Using Group Policy Preferences to Map Drives Based on Group Membership for details. I also encourage user education on showing them how to add network locations to their libraries.


2

http://support.microsoft.com/kb/303650


2

Yes it's entirely possible to have multiple logon scripts run in multiple GPO's, but maybe not quite in the way you want. First Option This method works quite well for us, however your needs may be different. Have multiple OU's and Sub-OU's and apply different GPO's with linked logon scripts further down the chain. Take the following OU structure - I have ...



Only top voted, non community-wiki answers of a minimum length are eligible