Questions tagged [logon-scripts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
27 votes
12 answers
344k views

Best way to find the computer a user last logged on from?

I am hoping that somewhere in Active Directory the "last logged on from [computer]" is written/stored, or there is a log I can parse out? The purpose of wanting to know the last PC logged on from is ...
Garrett's user avatar
  • 1,658
10 votes
2 answers
93k views

Run a Program Without User Being Logged On

I am running a Windows 7 installation, and I want to be able to run an application when there is no user logged in. The reason for this is that my application is a monitoring tool, and we want to be ...
Goro's user avatar
  • 674
8 votes
3 answers
16k views

GPO: Run PowerShell logon script after explorer.exe has been loaded

I know there is the GPO setting "Computer Configuration => Admin. Templates => System => Scripts => Run logon scripts synchronously". This, however, ensures that logon scripts run before Windows ...
Matthias Güntert's user avatar
5 votes
2 answers
1k views

When mapping Shares and Printers -- GPO or Logon Scripts?

I'd like to get everyone's opinion on whether it's better to use GPO or Logon Scripts when mapping shares and printers. From my understanding, please let me know if I'm wrong, GPO seems like a ...
Chris Charge's user avatar
5 votes
9 answers
4k views

What scripting language do you use for your logon scripts in your Windows enviroment?

I wonder what scripting languages is most used as logon scripts these days. Is people still hacking away in batch-file files or vbscripts, or do you use PowerShell or something completely different? ...
Egil Hansen's user avatar
4 votes
7 answers
35k views

Useful Logon Script Commands

Please post useful commands that you use in your logon script. Here are some that I use: map a network drive: net use v: \fileserver\apps map a network printer: RunDll32.EXE printui.dll,...
4 votes
1 answer
17k views

How to Extract command-line output into a Variable?

As part of a task that I am working on for a customer, I need to make some modifications to the enterprise logon script. Windows command-line is definitely not my area of expertise, but I am doing OK ...
RBarryYoung's user avatar
4 votes
1 answer
2k views

Using VBScript at logon to determine if powershell is installed

I have a mixture of Win7, and XP machines on my network. Every user logs on using a VBS based logon script and for clients that support it, I want to show an informational pop-up as shown here. How ...
makerofthings7's user avatar
3 votes
2 answers
28k views

Why is my logon script not mapping any drives?

I've written a logon script in PowerShell. The Script is embedded in GPO and runs when a user is logging into the domain. My Problem is, that the drives I deploy in the Script don't get deployed. I'm ...
SimonS's user avatar
  • 787
3 votes
3 answers
4k views

Powershell logon script (GPO) not running win 7

I have a powershell script that creates an Outlook signature. It is applied via user-assigned GPO. All users are in the same OU, the group policy object is linked to that OU. GPO: User ...
Docschnitzel's user avatar
3 votes
4 answers
4k views

What's the modern way to open a URL during logon?

Currently I am using this vbs script during logon to a Windows desktop: Set oIE = CreateObject("InternetExplorer.Application") ' This creates a Internet Explorer window oIE.Left = -5000 ...
David A Gibson's user avatar
3 votes
1 answer
3k views

When do the user logon scripts run?

I have several user logon scripts defined in active directory. These are batch scripts as well as powershell scripts. When do these actually run? Does the user see "black terminal boxes" when he logs ...
Heinrich's user avatar
  • 910
3 votes
2 answers
3k views

Do logon scripts run concurrently or consecutively?

Do Logon Scripts set via Group Policy (User Configuration\Windows Settings\Scripts (Logon/Logoff)) run concurrently or one after the other? The reason I ask is because I'm unsure whether it would be ...
David Gard's user avatar
3 votes
3 answers
4k views

Windows logoff script to modify registry under HKCU

I'm trying to modify registry entries within HKCU at logoff. The corresponding script works okay when invoked manually. I was afraid there might be issues with a loopback policy kicking in, but ...
Hagen von Eitzen's user avatar
3 votes
2 answers
2k views

Script on startup without update-rc.d

I've a debian minimal installation, and I just want to start a custom script at startup. I've a script at /etc/init.d/myscript, I put a chmod 700, and create symlinks to S20myscript into : /etc/rc2....
Jean-Philippe Blary's user avatar
3 votes
1 answer
1k views

Logon VBS script will not start programs

I am trying to have Group Policy run a Logon script for a User OU. The script runs, but the part where it creates a Shell Object to run, it does not load during logon. If I double-click the script, it ...
Canadian Luke's user avatar
3 votes
3 answers
4k views

Logon/Logoff scripts running when disconnected from domain controller

I have a windows 7 system that is part of a domain. When it is unable to access the domain controller, will it still run logon scripts? Right now, we have a local script that is launched from the run ...
Doltknuckle's user avatar
  • 1,274
3 votes
1 answer
475 views

Best approach to deploy DLL file updates to Win7 clients

We are in a Windows 7 / Server 2008 R2 domain environment. We have a .NET application with lots of internal libraries for different UI and other features. We deploy it from a share where a directory ...
Dmart's user avatar
  • 294
3 votes
1 answer
16k views

Overwrite files without prompt with File.CopyHere in logon script (vbs)

I'm trying to create a logon script (vbs) to install some fonts. If the fonts are installed I get a prompt saying "There's already a file with the same name in this location". How can I force the ...
Jonas Stensved's user avatar
2 votes
2 answers
6k views

Run script when user logs on or off

I am looking for a way to run a script1 when a user logs in2 AND and when they log out3 on their4 Windows5 machine. Notes: Perfect world script would mean Powershell script, but any script or ...
Robert MacLean's user avatar
2 votes
3 answers
18k views

GPO or logon scripts to remove access to public "libraries" folders

I have two Windows 2012 R2 Domain Controllers and will be implementing 7 Windows 2008 R2 remote desktop servers once their setup and testing is complete (I have one built now that is my test server). ...
quicksilver's user avatar
2 votes
2 answers
34k views

GPO logon script needs admin privledges

I'm using a logon batch script to copy some dll files into the c:\windows\system32 folder and register them with the regsrv32 command. However, both actions fail. I'm applying the script here: user ...
Force Flow's user avatar
  • 1,165
2 votes
2 answers
3k views

Apply GPO to user AD group when using computers in a certain OU

We have a logon-script that copies a number of remoteapp.rdp-files to some users desktops. However these users sometimes also has to connect directly to our terminal server through a remote desktop ...
Chobom's user avatar
  • 33
2 votes
4 answers
15k views

Active Directory logon script not updating

I've changed the logon.bat file (on the DC shared NETLOGON folder) The changes are basically altering the location of a mapped drive. When users log off, and log back on, they are still being mapped ...
alex's user avatar
  • 1,730
2 votes
2 answers
6k views

Can you create multiple separate Active Directory GPO Logon Scripts?

In my active directory I currently have a GPO on the domain object that contains a logon script. I want to create a new group that I can add users to and have it run an additional / different logon ...
Scott Szretter's user avatar
2 votes
1 answer
2k views

Slow logon with "Applying your personal settings..." message- only occurs when domain user is member of a security group

Domain user accounts on our network can log in in ~2 seconds when they are not a member of any security groups. However, this logon time increases to ~35 seconds when the are a member of any security ...
Austin ''Danger'' Powers's user avatar
2 votes
3 answers
2k views

Can I prevent logon scripts in one GPO from executing before those in the parent GPO finish?

According to this article, group policy is processed in descending order through the organization (ie start at forest, then domain, ou, etc). I have one GPO linked to the domain which runs a startup ...
just.another.programmer's user avatar
2 votes
0 answers
641 views

Logon script does not run for all users

We have a standalone common-use workstation running Windows XP Pro SP3 and have created a script using Javascript (scriptname.js) that is to be run for each user. The file was added as a user logon ...
Herohtar's user avatar
  • 121
1 vote
2 answers
599 views

Bat file in another account

I have a bat file which will delete files in some folder (Profile Folder). But i do-not have access to that folder. But another account has access to the folder. How to run a batch file from one ...
user avatar
1 vote
1 answer
146 views

Looking for Ideas and reasons to move from a single log on script to Group Policy

So currently our senior VP in IT has a single log on script that is run via ADUC and does things like install 3rd party updates, maps networked drives, inventories computers, copies files to desktop, ...
Ericrobert's user avatar
1 vote
5 answers
6k views

Replce Kix script with Powershell

We are looking to replace our current Kix scripts with Powershell scripts and I was curious how to test group membership to map network drives. Our current kix script basically just does an if ...
Justin Garrison's user avatar
1 vote
1 answer
3k views

User logon PowerShell script not running under Windows 7 or 10

I'm testing out upgrading to Windows 10 on our domain, which is currently based on a Windows Server 2012 DC and all Windows 7 workstations. I was never able to make it work on Windows 7 so I gave up ...
Gup3rSuR4c's user avatar
1 vote
1 answer
2k views

How to map drives to a specific user (rather than security group)?

We use a logon script to map drives for our domain users based on their security group membership. Here is an excerpt from the script, showing how anyone in the "_development (W)" group automatically ...
Austin ''Danger'' Powers's user avatar
1 vote
2 answers
10k views

users unable to add registry keys to HKCU

I may not have this 100% correct so need some clarification. Are normal users on a 2003 terminal server allowed to add registry keys the their own HKCU section in the registry, or are they only ...
James Edmonds's user avatar
1 vote
2 answers
2k views

Getting Windows 7 to run Scripts from Other Shares then NETLOGON

I have several Windows Server 2003 Environments I administer. These are separate disparate domains with their own structures and policies. I generalize as much as possible when I administer these ...
Laranostz's user avatar
  • 225
1 vote
4 answers
18k views

net use mapping not working in batch files but works in cmd

Ok so here's the problem : I've got users using logon script in the domain (username.bat). The script simply lists 4 or 5 (net use letter: \\SERVER\directory\). However, when they open their session, ...
Philippe's user avatar
1 vote
4 answers
20k views

NETLOGON scripts not being executed

Each user on our new domain needs to have drives mapped according to a batch file. The problem is, I have a GPO rule set to execute the following command on all domain logins: \\servername\netlogon\%...
codewario's user avatar
  • 558
1 vote
1 answer
1k views

Azure equivalent for logon script or Group Policy to launch programs on user login

We have a tool (portable exe) that runs from an on premises server in a traditional domain that launches on user login via GP (and can also run from logon script). It references a location on the ...
SKidd's user avatar
  • 61
1 vote
1 answer
3k views

Setup GPO Logon script using powershell

I have my logon script setup in GPO and looks like it wont work. The script was tested running good. My question is that do I have to change -ExcutionPolicy on all Client PCs? the target PC I tested ...
Root Loop's user avatar
  • 912
1 vote
1 answer
111 views

Help me exorcise my demon possessed logon script

I have a user logon script that copies a file over to a subfolder of the current user's profile path: Script (only showing the line that isn't working): copy /Y c:\records\javasettings_Windows_x86....
Detritus Maximus's user avatar
1 vote
5 answers
377 views

Windows 2003 User folder mapping issue

We have a windows 2003 standard domain server/client network with about 450 users. Each user has a login script that maps shares, and syncs the time to the server. Each user account also has a user ...
user avatar
1 vote
0 answers
25 views

Hiding Script Host error when network path not found

I have a Group Policy logon script that is located at and runs from the NETLOGON share. When a user is off domain and logs on, an error is displayed that the path is not found. This frightens and ...
NetAdmin's user avatar
1 vote
0 answers
377 views

Location of the log for Windows first logon commands

I have PowerShell script that's set up to run as the first logon command via the unattend.xml file. The script actually does run on the first logon but I would like to know if somewhere I can find the ...
Utkarsh's user avatar
  • 11
1 vote
0 answers
502 views

Logon script on windows server 2008 fails to run

I'm setting up two servers with windows server 2008, one running file, printer and application services, with the other one running Norman Endpoint Security. I've set up a logon script that in turn ...
Iron_wofle's user avatar
0 votes
2 answers
739 views

VBS Logon Script

Could someone please provide some assistance with VBS scripting? Here is what I have modified so far; Const GROUP1 = "cn=GROUP1" Const GROUP2 = "cn=GROUP2" Const GROUP3 = "cn=GROUP3" Set wshNetwork ...
Average Joe's user avatar
0 votes
4 answers
4k views

Setup Printers Based Upon AD Group Membership

I am trying to create a login script for Active Directory that will be used for installing printers on client computers. I have a basic script that we are using now, listed below, that installs a ...
John's user avatar
  • 2,276
0 votes
2 answers
242 views

Remove DNS logon script

I've added the a logon script for specific users so they have no access to the internet @ECHO OFF set vardns1=1.1.1.1 set vardns2=1.1.1.1 ECHO Setting Primary DNS netsh int ip set dns name = "Local ...
Andy Peterson's user avatar
0 votes
2 answers
7k views

Run Log-on Script with Admin Rights

I created a batch logon script that checks and removes old versions of a specific piece of software and installs the newest version. Both the install and uninstall process use an .EXE file. The script ...
iFetus's user avatar
  • 13
0 votes
1 answer
2k views

Logon Script, detect network status

I'm wondering if it it is possible to build a logon script, for Windows XP & Vista, that will detect where the user is connected to a particular network (Defined by IP schema). If they are ...
MikeT505's user avatar
  • 431
0 votes
4 answers
2k views

Change Location of Mapped Drive using VBScript at Logon

I have a script, applied by group policy, that runs at user logon to remove specific mapped drives if they exist and then remaps them. Here's an example of the script: Option Explicit Dim WshNetwork,...
pk.'s user avatar
  • 6,511