This is only affecting servers.  Our policy here is we only reboot one server at a time.  So by that basic policy there shouldnt be a problem there.  I do see your point though.
 
Jeff
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of joe
Sent: Sunday, April 02, 2006 4:19 AM
To: [email protected]
Subject: RE: [ActiveDir] Script not working thru GPO

One comment I thought of when looking at that is how well does it handle multiple machines trying to run it at the same time? As a general rule, it is very difficult to have multiple computers all trying to write to the same flat file. This could get ugly in a production environment.
 
  joe
 
--
O'Reilly Active Directory Third Edition - http://www.joeware.net/win/ad3e.htm 
 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cothern, Jeffrey D Mr CTR USSOCOM HQ
Sent: Thursday, March 30, 2006 2:37 PM
To: [email protected]
Subject: RE: [ActiveDir] Script not working thru GPO

Thanks for all your help.   I finally got the script working and doing everything I want it to do.  If anyone wants the script let me know.
 
Jeff
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Desmond
Sent: Wednesday, March 29, 2006 12:06 PM
To: [email protected]
Subject: RE: [ActiveDir] Script not working thru GPO

Is there any reason you’re not just expanding the %ComputerName% environment variable in your script?

 

As far as searching the file:

 

Dim line

Dim found

found = false

While Not objServerList.EOF

            Line = objServerList.ReadLine

            If line = strComputerName Then

                        found = true

            End If

Wend

 

If found then

            ‘ Do stuff

Else

            ‘ Do other stuff

End If

 

Thanks,
Brian Desmond

[EMAIL PROTECTED]

 

c - 312.731.3132

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cothern, Jeffrey D Mr CTR USSOCOM HQ
Sent: Wednesday, March 29, 2006 11:55 AM
To: [email protected]
Subject: RE: [ActiveDir] Script not working thru GPO

 

Foudn that problem and the other which was with objShell

 

Here is the working script. Now to find a way to have it check if the server name is already in the serverlist.txt file and if so skip to the end. 

 

Dim regComputerName
Dim strComputerName
Dim Serverlist
Dim objShell
Dim objServerlist
DIM objFSO
DIM strCurrenLine
DIM intIsComment
Const ForAppending = 8

 

Serverlist = "\\fileserver\serverlist.txt"
regComputerName = "HKLM\SYSTEM\CurrentControlSet\Control" & "\ComputerName\ComputerName\ComputerName"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objServerlist = objFSO.OpenTextFile(Serverlist, ForAppending)

 

Set objShell = CreateObject("WScript.Shell")
strComputerName = objShell.RegRead(regComputerName)
objServerlist.WriteLine (strComputerName)

 

objShell.RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\Application\AutoBackupLogFiles", 1, "REG_DWORD"
objShell.RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\Security\AutoBackupLogFiles", 1, "REG_DWORD"
objShell.RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\System\AutoBackupLogFiles", 1, "REG_DWORD"

 

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, March 29, 2006 9:20 AM
To: [email protected]
Subject: RE: [ActiveDir] Script not working thru GPO

What’s objFile being set to?

 

Set WshShell = WScript.CreateObject("WScript.Shell")
ComputerName = objShell.RegRead(regComputerName)
objfile.Write "ComputerName"

 

Hmm maybe I’m missing something entirely because I don’t see where objShell is being set to anything either… ?

 

 

:m:dsm:cci:mvp | marcusoh.blogspot.com

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cothern, Jeffrey D Mr CTR USSOCOM HQ
Sent: Wednesday, March 29, 2006 8:45 AM
To: [email protected]
Subject: RE: [ActiveDir] Script not working thru GPO

 

Thank you

 

    That fixed that line.. Now to another line.  As I mentioned before this script works fine outside of GPO.

    Do you see anything wrong with ComputerName = 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darren Mar-Elia
Sent: Tuesday, March 28, 2006 12:16 PM
To: [email protected]
Subject: RE: [ActiveDir] Script not working thru GPO

Good catch Kamlesh. Jeff, check out:

 

http://msdn.microsoft.com/library/default.asp?url=""> 

 

for an example of this.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kamlesh Parmar
Sent: Tuesday, March 28, 2006 8:59 AM
To:
[email protected]
Subject: Re: [ActiveDir] Script not working thru GPO

If this is the exact script then

Where have you defined value of "ForAppending" ??

 

As error  message contains "invalid argument"

 

--

Kamlesh

 

On 3/28/06, Cothern, Jeffrey D Mr CTR USSOCOM HQ <[EMAIL PROTECTED]> wrote:

I have a script i created in vbs.  This script works when run on the machines locally but when i set it up as a machine startup script it gets this error

 

script:

path and name of script

 

Line:13

Char: 1

Error: Invalid Procedure call or argument

Code: 800A0005

Source:  Microsoft _vbscript_ runtime error

 

As I said this runs correctly when run on the machine localy but not thru GPO.  I am assuming that I cannot do a objFSO.OpenTestFile thru the GPO.  Is there some other way I can accomplish the write to the test file?

 

Jeff

 

 

 

   Here is the Script Code:

 

Dim WshShell, bKey
Dim regComputerName
Dim ComputerName
Dim Serverlist
Dim objServerlist
DIM objFSO
DIM strCurrenLine
DIM intIsComment

 

Serverlist = "\\fileserver\serverlist.txt"
regComputerName = "HKLM\SYSTEM\CurrentControlSet\Control" & "ComputerName\ComputerName\ComputerName"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objServerlist = objFSO.OpenTextFile(serverlist, ForAppending)

 


Set WshShell = WScript.CreateObject("WScript.Shell")
ComputerName = objShell.RegRead(regComputerName)
objfile.Write "ComputerName"

 

WshShell. RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\Application\AutoBackupLogFiles", 1, "REG_DWORD"
WshShell. RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\Security\AutoBackupLogFiles", 1, "REG_DWORD"
WshShell. RegWrite"HKLM\System\CurrentControlSet\Services\Eventlog\System\AutoBackupLogFiles", 1, "REG_DWORD"

 


bKey = WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\Application\AutoBackupLogFiles")
bKey = WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\Security\AutoBackupLogFiles")
bKey = WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\System\AutoBackupLogFiles")

 

WScript.Echo WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\Application\AutoBackupLogFiles")
WScript.Echo WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\Security\AutoBackupLogFiles")
WScript.Echo WshShell.RegRead("HKLM\System\CurrentControlSet\Services\Eventlog\System\AutoBackupLogFiles")
 

 




--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Be the change you want to see in the World"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to