Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

GPO 2003 server and logoff scripts

Posted on 2013-01-17
6
374 Views
Last Modified: 2013-08-31
I have the following question, I have a windows 2003 domain, now I have to use a logoff script. It is visible, it is working but now: in logoff script there is a cmd script file. In this cmd file I starting a second script, a vbs script. Working fine. But now, each time the cmd script is visible and I'm looking to a method to hide this or minimize the cmd script.

Does someone got some experience how to do this via Group policy?
0
Comment
Question by:Davy_VK_72
6 Comments
 
LVL 35

Accepted Solution

by:
Joseph Daly earned 500 total points
ID: 38789033
Below is a small VBS script that will allow you to run batch file hidden.

Option Explicit

Dim i, strArguments, wshShell

If WScript.Arguments.Count = 0 Then Syntax
If WScript.Arguments(0) = "/?" Then Syntax

strArguments = ""

For i = 0 To WScript.Arguments.Count - 1
	strArguments = strArguments & " " & WScript.Arguments(i)
Next

Set wshShell = CreateObject( "WScript.Shell" )
wshShell.Run Trim( strArguments ), 0, False
Set wshShell = Nothing


Sub Syntax
	Dim strMsg
	strMsg = "RunNHide.vbs,  Version 2.00" & vbCrLf _
	       & "Run a batch file or (console) command in a hidden window" & vbCrLf _
	       & vbCrLf _
	       & "Usage:  RUNNHIDE.VBS  some_command  [ some_arguments ]" & vbCrLf _
	       & vbCrLf _
	       & "Where:  ""some_command""    is the batch file or (console) command" & vbCrLf _
	       & "                          you want to run hidden" & vbCrLf _
	       & "        ""some_arguments""  are optional arguments for ""some_command""" & vbCrLf _
	       & vbCrLf _
	       & "Based on a ""one-liner"" by Alistair Johnson" & vbCrLf _
	       & "www.microsoft.com/technet/scriptcenter/csc/scripts/scripts/running/cscte009.mspx" _
	       & vbCrLf & vbCrLf _
	       & "Written by Rob van der Woude" & vbCrLf _
	       & "http://www.robvanderwoude.com"
	WScript.Echo strMsg
	WScript.Quit 1
End Sub

Open in new window

0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 38789040
Credit for where this actually came from.
http://www.robvanderwoude.com/sourcecode.php?src=runnhide_vbs
0
 
LVL 25

Expert Comment

by:Tony Giangreco
ID: 38789134
Here is more info regarding the logoff script

http://technet.microsoft.com/en-us/library/cc739591(v=ws.10).aspx
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:Davy_VK_72
ID: 38789168
the problem is, that I starting a cmd script, and this script is starting another vb script, but this vb script is starting only after the check of a file on the workstation. If there is no file, vb script is not starting. But the cmd script is starting up and is visible, the question is how to configure gpo setting (logoff scripts) to minimize the cmd script.
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 38789186
You would use the runhide.vbs and then call your CMD script.
0
 
LVL 25

Expert Comment

by:Lionel MM
ID: 38792895
You hide logon and logoff scripts with these settings in GPO--see picture
Computer config--Admin templates--system--scripts
Hide-Logoff-Scripts.jpg
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question