I am looking for the microsoft scripting tools. Can anyone give me the names of tools that NT Administrators use for
Win2k and others? thanks in advance.
The only problems I have had with WHS is NAV picks up the script as a virus.. DOH 9 but it ant. Here have a nice login on me A and thanks to the writers).
'~~[author]~~
Noel P. Luneau
'~~[/author]~~
'~~[comment]~~
Uses IE as a shell to Map Drives, Add Icons, Make Registry changes, etc. No extra Dll's or exe's required. Logs login times and info about user
workstation. Tested with Win2K and XP.
Directions for Win2K/XP
1. Create or use existing Organization Unit (OU) for selected users. 2. Create new or use existing group policy object for selected users. 3. Extract Login.wsf, Log.vbs and legal.txt. 4. Add login.wsf as logon script and copy all extracted file to same directory. 5. Set Your User Defined System Variables below. 6. Add your custom mapping, icon placements and run programs. 7. Test Login.wsf from the \sysvol\domain.com\scripts directory 8. When it works and replication is successful then test via login 9. Have fun cause that's why we're here ... right? riiiiight!
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Declarations and Constants '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim bStopClick, bUserClose ' as boolean
Const sCaption = "Login Script" ' titlebar caption
Const READYSTATE_COMPLETE = 4 ' from enum of tagREADYSTATE...
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Instantiate Internet Explorer '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim oIE : Set oIE = WScript.CreateObject("InternetExplorer.Application",
"oIE_"
With oIE : .left = 40 : .top = 80 : .width = 400 : .height = 205
.menubar = False : .toolbar = False : .statusbar = False : End With
oIE.navigate("about:blank" ' start with dummy page
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'wait for html page to load...
'while oIE.Busy: WScript.Sleep 100: Wend
'uh-oh, according to mHarris (wshNG), IE sometimes "lies" about being busy, 'and so we'll use ReadyState instead (hopefully readystate doesn't lie). '(If readystate lies too, maybe we could use the "DocumentComplete" event)... '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
While oIE.ReadyState <> READYSTATE_COMPLETE : Wscript.Sleep 100 : Wend
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Load html into the oIE.document '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim oDoc : Set oDoc = oIE.document ' get the document object...
oDoc.Open "text/html" ' open document for writing...
oDoc.Write GetResource("sDlg_HTML"
oDoc.Close
while oIE.ReadyState <> READYSTATE_COMPLETE : Wscript.Sleep 100 : wend
' move "Microsoft Internet Explorer" off to the side...
oDoc.Title = sCaption & String(25, Chr(160)) ' note: Chr(160) is the 2nd ansi blank
' finished w/html, show the dialog...
oIE.Visible = True
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'script running (wait for close)
'show some progress messages... '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
oDoc.all.msgLine2.innertext = " The Time is now: " & CStr(Time)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Initialization '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim WshFS
Dim WshF
Dim WshFDC
Dim WshFile
Dim WshFSource
Dim WshAE
Dim WshTSc
Dim WshSW
Dim WshReg
Dim WSHNetwork
Dim WshShell
Dim WshProcessEnvironment
Dim WshLogonServer
Dim strScriptFullName
Dim WshLogonPath
Dim WshInstall
Dim WshCopy
Dim WshSys32
Dim WshSysRoot
Dim EnvWinDir
Dim strSource
Dim strDest
Dim IPAddress
Dim SubnetMask
Dim OS
Dim Username
Set WshFS = WScript.CreateObject("Scripting.FileSystemObject"
Set WSHNetwork = WScript.CreateObject("WScript.Network"
Set WshShell = WScript.CreateObject("WScript.Shell"
Set WshProcessEnvironment = WshShell.Environment("Process"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Set Your User Defined System Variables '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim UseNTServer
'Sets the running of this logon on Windows NT Servers to Yes. To Change it set the value to no UseNTServer = "no" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim DomainName
'Sets the Users Domain
DomainName = "DOMAIN" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Sets the path to the NT Share to write Logs
Const LOGPATH = "\\SERVER\LOGS\" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Sets the path to the NT Share where icons are stored
Const IconSource = "\\SERVER\Copy\" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim ShareSvr
'Sets the NT Server that drives are mapped to
ShareSvr="SERVER" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim LogonSvr
'Sets the NT Server that is the default logon for win9x clients LogonSvr="SERVER" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim CompanyName
'Sets the Users Company Name
CompanyName = "Company Name" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
oDoc.all.head.innertext = CompanyName
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Determine OS '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
OS = WshProcessEnvironment("OS"
If OS <> "Windows_NT" Then
OS = "Win32"
strScriptFullName = Wscript.ScriptFullName
WshLogonServer = mid(strScriptFullName, 1,
instr(3,strScriptFullName,"\"-1) 'seems to work with and without
the -1
WshSysRoot = WshShell.ExpandEnvironmentStrings("%SYSTEMROOT%"
WshLogonPath = WshLogonServer & "\netlogon"
EnvWinDir = WshProcessEnvironment("windir"
WshSys32 = EnvWinDir & "\system\"
End If
If UseNTServer = "yes" then
If OS = "Windows_NT" Then
WshLogonServer =
WshShell.ExpandEnvironmentStrings("%LOGONSERVER%"
WshSysRoot = WshShell.ExpandEnvironmentStrings("%SYSTEMROOT%"
WshLogonPath = WshLogonServer & "\netlogon"
EnvWinDir = WshProcessEnvironment("windir"
WshSys32 = EnvWinDir & "\system32\"
End If
Else
If OS = "Windows_NT" Then
IF WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions\ProductType" = "WinNT" Then
WshLogonServer =WshShell.ExpandEnvironmentStrings("%LOGONSERVER%"
WshSysRoot = WshShell.ExpandEnvironmentStrings("%SYSTEMROOT%"
WshLogonPath = WshLogonServer & "\netlogon"
EnvWinDir = WshProcessEnvironment("windir"
WshSys32 = EnvWinDir & "\system32\"
End If
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Get Username '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Pause Script until User is Logged in
On Error Resume Next
Username = ""
Do
Username = WSHNetwork.UserName
Loop Until Username <> ""
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Init Variables '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Do
strUserID = WSHNetwork.UserName
Loop Until strUserID <> ""
'Get User Object
'** Set this for your Domain
Set UserObj = GetObject("WinNT://" & DomainName & "/" & strUserID)
'Init Groups
Dim UserGroups
Dim GroupObj
UserGroups=""
For Each GroupObj In UserObj.Groups
UserGroups=UserGroups & "[" & GroupObj.Name & "]"
Next
Dim strUserID 'User Name
Dim strPCName 'PC Name
Dim UserObj 'User NT Object
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''Init Display '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
oDoc.all.msgLine1.innertext = "Welcome User " & strUserID & " on Machine\\" & strPCName
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Display intro '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
oDoc.all.msgLine3.innertext = " ... Now Logging into " & DomainName
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Security Screen
'Legal.txt is the same as the following text '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copy Legal.txt to C:\Legal.txt
' CopyFile WshCopy & "legal.txt", "c:\legal.txt"
' Legal Text
Text = "This computer is the property of " & CompanyName & ". It is for authorized use only. Users (authorized or unauthorized) have no explicit or implicit expectation of privacy. "
' LoginBox.SetDisplayMessage(Text)
' Text = Text & vbcrlf & ""
' LoginBox.SetDisplayMessage(Text)
' Text = Text & vbcrlf & "Any or all uses of this system and all fileson this system may be intercepted, monitored, recorded, copied, audited, inspected, and disclosed to authorized sites, " & CompanyName & " and law enforcement personnel. By using this system, the user consents to such interception, monitoring, recording, copying, auditing, inspection, and disclosure at the discretion of " & CompanyName & ". "
' LoginBox.SetDisplayMessage(Text)
' Text = Text & vbcrlf & ""
' LoginBox.SetDisplayMessage(Text)
' Text = Text & vbcrlf & "Unauthorized or improper use of this system may result in administrative disciplinary action and civil and criminal penalties. By continuing to use this system you indicate your awareness of and consent to these terms and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions stated in this warning. "
' LoginBox.SetDisplayMessage(Text)
' Text = Text & vbcrlf & ""
' LoginBox.SetDisplayMessage(Text)
' Text = Text & vbcrlf & "To read a copy of this NOTICE please open c:\legal.txt on this system."
' LoginBox.SetDisplayMessage(Text)
If OS = "Win32" Then
If WshFS.FileExists(WshLogonPath & "\log.vbs" Then
WshShell.Run WshLogonPath & "\log.vbs", 0, True
End If
Else
If WshFS.FileExists(WshLogonPath & "\log.vbs" Then
WshShell.Run WshLogonPath & "\log.vbs", 0, True
End If
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'End Program '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
WScript.Sleep 100
oDoc.all.msgLine3.innertext = ""
' advise user, that we are closing now... oDoc.all.msgLine1.style.color = "RED" ' chanage text color
oDoc.all.msgLine1.innertext = " Script Completed - Closing Now...
"
oDoc.all.msgLine2.innertext = " (window will close in 2 secs)"
WScript.Sleep 2500
oIE.Visible = False ' close internet explorer...
Set oDoc = nothing
Set oIE = nothing
WScript.Quit
'LoginBox.SetWaitMessage("Read Security Policy and Press Done when complete ... "
' If UseLogonScreen = "yes" then LoginBox.Pbar(100)
' LoginBox.TimerSet(30) 'This sets the countdown timer value.
' Wscript.quit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'END OF SCRIPT '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Make manual changes to local PC Registry '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub UpdateRegistry
'Clear last user
WSHShell.RegWrite "HKCU\Network\Logon\username", ""
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Setup Drives / Icons '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub ConfigurePC
On Error Resume Next
' Setup User's Home Directory (U Drive)
WSHNetwork.RemoveNetworkDrive "U:","True"
'Wscript.Sleep (5000)
MapDrive "U:", strUserID & "$"
If InGroup("PRINTER1" Then
ShareSvr = "SERVER"
WshNetwork.RemovePrinterConnection "PRINTER1:",1,1
WshNetwork.AddPrinterConnection "PORT1:", "PRINTER1", 1 End If
If InGroup("PRINTER2" Then
ShareSvr = "SERVER"
WshNetwork.RemovePrinterConnection "PRINTER2:",1,1
WshNetwork.AddPrinterConnection "PORT2:", "PRINTER2", 1 End If
Sub GROUP1
AddIcon "Menu", "GROUP1.lnk"
AddIcon "DT", "GROUP1.Lnk"
End Sub
Sub GROUP2
AddIcon "Menu", "GROUP2.lnk"
AddIcon "DT", "GROUP2.Lnk"
End Sub
Sub GROUP3
AddIcon "Menu", "GROUP3.lnk"
AddIcon "DT", "GROUP3.Lnk"
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Add Icon to User's PC '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub AddIcon (strLocation, Icon)
If strLocation= "DT" Then CopyFile IconSource & Icon, DesktopPath & "\"
If strLocation= "Menu" Then CopyFile IconSource & Icon, ProgramsPath & "\" End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Convert Current Date to FileName '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function DateToStr()
DateToStr = DatePart("yyyy",Now()) & DatePart("m",Now()) &
DatePart("d",Now())
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Function: MapDrive
' Arguments: Drive Letter (with ":" and Share Name on ShareSvr ' Description: Maps Share' mapping CANNOT exist already '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub MapDrive( strDrive, strShare )
Dim Path
If InStr(strShare,"\" then
Path=strShare
Else
Path="\\" & ShareSvr & "\" & strShare
End If
' Map drive
On Error Resume Next
WSHNetwork.MapNetworkDrive strDrive, Path
' End Sub result
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Return Date of File '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function FileDate(filespec)
Dim fso
Dim f
DateCreated = 0
On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject"
Set f = fso.GetFile(filespec)
FileDate = f.DateLastModified
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Function: CopyDir
'Parameters:
' strSourceDir - where the files are coming from
' strDestDir - where the files are going
'
' This function copies the contents of one directory to another '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function CopyDir(strSourceDir, strDestDir)
Dim lfsObject
Dim lFileList
Dim lFolder
Dim lFile
Set lfsObject = CreateObject("Scripting.FileSystemObject"
Set lFolder = lfsObject.GetFolder(strSourceDir)
Set lFileList = lFolder.Files
For Each lFile in lFileList
lfsObject.CopyFile strSourceDir & "\" & lFile.Name, strDestDir & "\" & lFile.Name
Next
Set lfsObject = nothing
Set lFolder = nothing
Set lFileList = nothing
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Function: CopyFile
'Parameters:
' strSourceDir - where the files are coming from
' strDestDir - where the files are going
'
' This function copies the file '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub CopyFile(strSource, strDest)
Dim lfsObject
Dim Source
On Error Resume Next
Set lfsObject = CreateObject("Scripting.FileSystemObject"
Set Source = lfsObject.GetFile(strSource)
Source.Copy strDest
Set lfsObject = nothing
If Err.Number <> 0 Then WriteErr( strUserID & ": Copy " & strSource & " to " & strDest & " " & Err.Description & " " & Now() ) End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Function: Make New Directory '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function MD(strDirName)
Dim lFSObj, lFolder
' First See if it already exists
set lFSObj = Wscript.CreateObject("Scripting.FileSystemObject"
set lFolder = lFSObj.GetFolder(strDirName)
If Err.number = 0 then
' Yes, it does exist so we don't have to do anything
MD = True
Else
Err.Clear
lFSObj.CreateFolder(strDirName)
If Err.Number <> 0 Then
MD = False
Else
MD = True
End If
End If
Set lFolder = Nothing
Set lFSObj = Nothing
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Function: Return value of specified environment string
'
' Arguments: Environment variable to find
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function GetEnv(strName)
Dim strEnv
GetEnv = ""
strName=UCase(strName)
For Each strEnv In WshProcessEnvironment
If strName = UCase(Left(strEnv,Len(strName))) Then
GetEnv=Right(strEnv,Len(strEnv)-Len(strName)-1)
Next
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Function: Check if user is in Group
'
' Arguments: Group to check membership of
'
' Note: Requires pre-initialization of UserGroups variant '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function InGroup(strGroup)
InGroup=False
If InStr(UserGroups,"[" & strGroup & "]" Then
InGroup=True
LoginMsg strGroup
End If
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Delete FIle '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub DeleteFile(strFile)
Dim fso
Dim File
On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject"
Set File = fso.GetFile(strFile)
File.Delete
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function copies the contents of one directory to another '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function CopyFiles(strSourceDir, strDestDir)
On Error Resume Next
Set lfsObject = CreateObject("Scripting.FileSystemObject"
Set lFolder = lfsObject.GetFolder(strSourceDir)
If strSourceDir > "" then
Set NewFolder = lfsObject.CreateFolder(strDestDir)
' WScript.Echo "Copy Source: " & strSourceDir & " Dest: " & strDestDir
'Process contained files first
Set lFileList = lFolder.Files
For Each lFile in lFileList
lfsObject.CopyFile strSourceDir & "\" & lFile.Name, strDestDir & "\" & lFile.Name
Next
'Process subdirectories
Set lSubFolders = lFolder.SubFolders
For Each lSubFolder in lSubFolders
NewSource = strSourceDir & "\" & lSubFolder.Name
NewDest = strDestDir & "\" & lSubFolder.Name
CopyFiles NewSource, NewDest
Next
End If
Set lfsObject = Nothing
Set lFileList = Nothing
Set lFolder = Nothing
Set lFile = Nothing
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' This function deletes all Files specified '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function DelFiles(strSourceDir)
Dim lfsObject
Dim lFileList
Dim lFolder
Dim lFile
On Error Resume Next
Set lfsObject = CreateObject("Scripting.FileSystemObject"
Set lFolder = lfsObject.GetFolder(strSourceDir)
' WScript.Echo "Delete: " & strSourceDir
'Process contained files first
Set lFileList = lFolder.Files
For Each lFile in lFileList
lFile.Delete
Next
'Process subdirectories
Set lSubFolders = lFolder.SubFolders
For Each lSubFolder in lSubFolders
NewSource = strSourceDir & "\" & lSubFolder.Name
DelFiles NewSource
lSubFolder.Delete
Next
Set lfsObject = Nothing
Set lFileList = Nothing
Set lFolder = Nothing
Set lFile = Nothing
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Determine Drive Size '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function DriveSize (strDrive)
Dim oFileSys, Drive
Set oFileSys = CreateObject("Scripting.FileSystemObject"
On Error Resume Next
Set Drive = oFileSys.GetDrive(strDrive)
DriveSize=Int( Drive.TotalSize/(1024^2) )
End Function
Function DriveSizeFree (strDrive)
Dim oFileSys, Drive
Set oFileSys = CreateObject("Scripting.FileSystemObject"
On Error Resume Next
Set Drive = oFileSys.GetDrive(strDrive)
DriveSizeFree=Int( Drive.FreeSpace/(1024^2) )
End Function
'''''''''''''''''''''''''''''''''''''''
' Function: Check for existence of file system object
'
' Argument: Name of Object (file or Directory) to check for. '''''''''''''''''''''''''''''''''''''''
Function IfExist(strName)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject"
IfExist = False
On Error Resume Next
If fso.FileExists(strName) Then IfExist = True
If fso.FolderExists(strName) Then IfExist = True
Set fso = Nothing
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'END OF FUNCTIONS '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Get the Distinguished name of the user
sUserDN = adsys.username
line = "UserDN: " & sUserDN
appendit(line)
'Get the User's telephone extension
Set oUser = Getobject(sPrefix & sUserDN)
sUserExt = oUser.homePhone
line = "Ext: " & sUserExt
appendit(line)
'Get the user's group membership
count = 1
line = "Group Membership:"
appendit(line)
aMems = oUser.GetEx("memberOf"
For each mem in aMems
line = count & " " & mem
appendit(line)
count = count + 1
Next
line = ""
appendit (line)
'Get the short name of the machine
sMach = wscr.computername
line = "PC DETAILS:" & chr(13) & chr(10) & "Computer: " & sMach
appendit(line)
'Get the DN of the machine
sMachDN = adsys.computername
line = "PC_DN: " & sMachDN
appendit(line)
'Get the sitename
sSite = adsys.sitename
line = "Site: " & sSite
appendit(line)
'Get the IP details
set IPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//localhost".ExecQuery("select ServiceName, IPAddress, IPSubnet,DefaultIPGateway, DHCPServer,DHCPLeaseObtained, DNSServerSearchOrder, MACAddress, WINSPrimaryServer,WINSSecondaryServer from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE"
Count = 0
for each IPConfig in IPConfigSet
Count = Count + 1
next
x = 1
if Not IsNull(IPConfig.DNSServerSearchOrder) then
for j=LBound(IPConfig.DNSServerSearchOrder) to UBound(IPConfig.DNSServerSearchOrder)
line = "DNS " & x & ": " & IPConfig.DNSServerSearchOrder(j)
appendit(line)
next
end if
Count = Count + 1
next
line = chr(13) & CHR(10)
appendit(line)
line = "DRIVE MAPPINGS and PRINTERS:"
appendit(line)
'Get the Network Drives mapped
For i = 0 to oDrives.Count - 1 Step 2
line = "Drive " & oDrives.Item(i) & " = " & oDrives.Item(i+1)
appendit(line)
Next
line = chr(13) & CHR(10)
appendit(line)
'Get the Printers connected
For i = 0 to oPrinters.Count - 1 Step 2
line = "Port " & oPrinters.Item(i) & " = " & oPrinters.Item(i+1)
appendit(line)
Next
f.close
wscr.RemoveNetworkDrive "Y:"
'//////////////
Function AppendIt(input)
f.Writeline input
end function
This computer is the property of COMPANY.
It is for authorized use only. Users (authorized or unauthorized) have no explicit or implicit expectation of privacy.
Any or all uses of this system and all files on this system may be intercepted, monitored, recorded, copied, audited, inspected, and disclosed to authorized sites, COMPANY and l aw enforcement personnel. By using this system, the user consents to such interception, monitoring, recording, copying, auditing, inspection, and disclosure at the discretion of COMPANY.
Unauthorized or improper use of this system may result in administrative disciplinary action and civil and criminal penalties. By continuing to use this system you indicate your awareness of and consent to these terms and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions stated in this warning.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.