Re: writing to a share during computer startup script
- From: "Andrew Madsen" <andrew.madsen@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 23 Sep 2005 15:16:51 -0500
This I believe is a rights issue on the share you are attempting to write
to.
--
Andrew C. Madsen
Network Specialist
Harley-Davidson Motor Company
<cincyman12@xxxxxxxxx> wrote in message
news:1127506212.693277.319930@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hello,
>
> We have recently implemented a GPO with a computer startup script to
> restore our required support accounts to the local administrators group
> on our end user systems. The only issue I am having is writting the
> audit log file on a shared drive. The script works perfectly if I run
> it manually after I login in. But when utilized during the computer
> startup script it does not add the entry to the log file. Below is my
> script. Any help would be greatly appreciated.
>
> Set ws = WScript.CreateObject("WScript.Shell")
>
> strComputer = ws.ExpandEnvironmentStrings ( "%COMPUTERNAME%" )
>
> Set objLocADMGroup = GetObject("WinNT://" & strComputer &
> "/Administrators,group")
> set objADMGroup = GetObject("WinNT://mydom/Domain Admins,group")
> set objSvrADMGroup = GetObject("WinNT://mydom/Server Admins,group")
> set objFSADMGroup = GetObject("WinNT://mydom/FieldSupp,group")
> On Error Resume Next
>
> For each objMember in objLocADMGroup.Members
>
> if objMember.Name = objADMGroup.Name then DomainAdmin = True
> if objMember.Name = objSvrADMGroup.Name then ServerAdmin= True
> if objMember.Name = objFSADMGroup.Name then FieldSupp = True
>
> Next
>
>
>
> if ServAdmin = False then
> objLocADMGroup.Add("WinNT://mydom/Server Admins,group")
> End if
> if DomainAdmin = False Then
> objLocADMGroup.Add ("WinNT://mydom/Domain Admins,group")
> End if
> if FieldSupp = False then
> objLocADMGroup.Add ("WINNT://mydom/FieldSupp,group")
> End if
>
> if FieldSupp = false or DomainAdmin = false then
> msgbox("A Mandatory Administrative group was removed from the local
> administrators group on this system. The group has been restored and
> the incident logged. Please refrain from removing administrative
> accounts from the system.")
> Const ForAppending = 8
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objTextFile = objFSO.OpenTextFile
> ("\\192.168.82.231\LAL\adminremoved.log",ForAppending, True)
> objTextFile.WriteLine(strComputer & " " & Date & " " & Time)
> bjTextFile.Close
> End If
>
.
- Follow-Ups:
- Re: writing to a share during computer startup script
- From: cincyman12
- Re: writing to a share during computer startup script
- References:
- writing to a share during computer startup script
- From: cincyman12
- writing to a share during computer startup script
- Prev by Date: writing to a share during computer startup script
- Next by Date: Finger
- Previous by thread: writing to a share during computer startup script
- Next by thread: Re: writing to a share during computer startup script
- Index(es):
Relevant Pages
|
Loading