Passing Passwords Between Pages
I need to pass my students password between pages for the student to take
their Federal Test.
PageA the student enters his Password
<Input Type="Text" Name="PssWrd"> The student then goes to Page B
PageB <!--Student Selects Location of School-->
<Input Type="Hidden" Name="APssWrd" Value="<%=Request("PssWrd")%>
Above Statement PassWord comes in fine.
<Map Name="District ElPaso"
<! District 835 ->
<Area Shape="Polygon" Coords="364, 117, 363, 130"
Href="Page835.asp?DistCd=WI835">
<! District 777 ->
<Area Shape="Polygon" Coords="119, 68, 111, 111"
Href="Page777.asp?DistCd=WH777">
<! District 654 ->
<Area Shape="Polygon" Coords="267, 58, 261, 79"
Href="Page653.asp?DistCd=WD653">
<! District 569 ->
<Area Shape="Polygon" Coords="82, 16, 37, 9" Href="Page569.asp?DistCd=WA569">
</Map>
When I go to any of the four pages on the Map, the password will not come
with any of those four pages. The pages come up fine, but no password.
Does anyone know how to do this. This is the first Time I have ever called
a page based on where the student selects from a map.
Does anyone know what I need to do?
Thanks in advance
Granny Tag: Enable/Disable NIC with a script Tag: 182933
Script to copy text to clipboard
Hello
Two questions:
1. I need a simple script to copy a defined text that is set within the
script to the clipboard.
2. What is the best book or source to begin learning vbs. Is there a
perferred book? Needs to start at the beginning and be a simple as
possible for starters.
Thanks in advance. Tag: Enable/Disable NIC with a script Tag: 182932
Session Variables
Running Windows Server 2003
IIS 6.0
Session Variables are not passing from page to page
Hitting refresh causes new Session ID
Help!!!!!
Thanks, hallgirl
--
Thanks Much!
hallgirl Tag: Enable/Disable NIC with a script Tag: 182924
Script Question
Hi All,
I need to run a command called moveuser (replaces the local profile with the
profile of a new user) using script which is distributed via SMS 2003. The
script needs to be run under the security context of a domain admin. I tried
runas but it didn't work. I believe the problem is that the script runs
under security context of Local System account which is not sufficient for
me. The following is the example of runas which did not work. SMS 2003
reports the the script result as success. No error messages are reported. Is
there anyone who would suggest some other way with an example or tell me
where I'm going wrong?
Regards,
Yaman
Dim WshShell
Set WshShell = WScript.CreateObject ("WSCript.shell")
WshShell.run "runas /user:newdomain\administrator " & """" & "moveuser
olddomain\olduser newdomain\newuser" & """"
WScript.Sleep 100
WshShell.SendKeys "P@ssw0rd~"
WScript.Sleep 100
WshShell.SendKeys "~" Tag: Enable/Disable NIC with a script Tag: 182921
Logon Script
I dont know much about scripting, and Im in somewhat of a crunch for this.
I need to know how to collect a terminal services/citrix client IP address
and match it to a network# from a list to determine what printers to map for
that user.
The problem is that I need this script to work even if there isnt a terminal
service/citrix client ip. In that case it would need to use the system IP
that the user is logged onto.
The goal of this script is to allow users to roam around from site to site
and login to any system, but have the correct printers mapped for that
location.
Before mapping the printers though it would need to remove any current
mapped ones as well.
Thank you. Tag: Enable/Disable NIC with a script Tag: 182911
Running VBScript in Scheduler without logging in
I have a simple VBScript that calls up MS Access, runs a macro to retrieve
data from an ODBC database, and then calls up MS Excel, and runs a macro to
format the retrieved data. This script, as listed below, runs fine if I start
it manually. It also works fine if I schedule it to run every night but with
my Windows session logged on. If I leave the machine on, but without logging
on, the VBScript will start but never end. I think it fails to start MS
Access. I do not have Admin priviledge on the computer which is running Win
XP Pro.
Is this a security related issue? How can workaround this other than trying
to gain Admin pivilege for my user account?
--
Teddy
********* Script starts below ************
Shared_Folder = "C:\RMM\Reports"
' Create Log File if it doesn't already exist
LogFilePath = Shared_FOlder & "\Mid-Week LogFile.txt"
Set oFSO = CreateObject("Scripting.FileSystemObject")
SET oLogFile = oFSO.CreateTextFile(LogFilePath, True)
oLogFile.WriteLine(LogLine)
oLogFile.WriteLine("Log File Initially Created : " &Date &" - " &Time)
oLogFile.WriteLine(LogLine)
Dim ObjAccess
Dim ObjExcel
'
' Open Access DB and run Mid_Week_Reports
'
oLogFile.WriteLine("MS Access Started: " &Date &" - " &Time)
Set ObjAccess = CreateObject("ACCESS.APPLICATION")
' ObjAccess.Visible = FALSE
ObjAccess.OpenCurrentDatabase ("c:\RMM\REPORTS\RMM Data Analysis (AUTO).mdb")
ObjAccess.Run ("RUN_Mid_week")
ObjAccess.Quit
Set ObjAccess = Nothing
oLogFile.WriteLine("MS Access Finished: " &Date &" - " &Time)
'
' Open Excel to update all traffic reports
'
oLogFile.WriteLine("MS Excel Started: " &Date &" - " &Time)
Set ObjExcel = CreateObject("EXCEL.APPLICATION")
' ObjExcel.DisplayAlerts=TRUE
' ObjExcel.Visible=TRUE
ObjExcel.Run ("'C:\RMM\REPORTS\Update All
Reports.xls'!Update_Traffic_Reports")
ObjExcel.Quit
Set ObjExcel = Nothing
oLogFile.WriteLine("MS Excel Finished: " &Date &" - " &Time) Tag: Enable/Disable NIC with a script Tag: 182908
Sample Dictionary Script(Newbie)
Can someone tell me this sample script out of the Microsoft Press book
by Ed Wilson won't run properly?
When I run it is displays every file in the folder, the same number of
times that there are files in the folder....
IE...if there are nine files in the folder it shows all nine files nine
times with a different file size for each one. Any help would be
appreciated.
Thanks:
'===================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies
PrimalSCRIPT(TM)
'
' NAME: <filename>
'
' AUTHOR: ed wilson , mred
' DATE : 9/21/2003
'
' COMMENT: <comment>
'
'===================================================================
Option Explicit
Dim objDictionary
Dim objFSO
Dim objFolder
Dim colFiles
Dim objFile
Dim colItems
Dim colKeys
Dim strKey
Dim strItem
Set objDictionary = CreateObject("scripting.dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\scriptingBook")
Set colFiles = objFolder.Files
For Each objFile In colFiles
objDictionary.Add objFile.Name, objFile.Size
Next
colItems = objDictionary.Items
colKeys = objDictionary.Keys
For Each strKey In colKeys
For Each strItem In colItems
WScript.Echo "filename: " & strKey & " size: " & strItem
Next
Next
WScript.Echo "***there are " & objDictionary.Count & " files" Tag: Enable/Disable NIC with a script Tag: 182905
Search a text file and replace text vbscript
I need some help and I still don't know the best way to accomplish
this. I need to search a license file that is a regualr asci text file
c:\gadgets\test.lic file and replace a line in the c:\gadgets\test.lic
and save it. What is the easiest way to accomplish this? And do I
save it out to a .vbs extenion?
The line I need to search for is: SERVER="chicago"
IPADDRESS="192.168.1. 5"
The Line I need to replace with is: SERVER="corporate"
IPADDRESS="192.168.1.45"
Thanks for anyone who reads this and/or helps me out.
-C Tag: Enable/Disable NIC with a script Tag: 182904
Filename with date modified appended to filename
need to find a way to change filenames that relect the filename and
the date modified. I have found numerous ways to get the current date
and time appended to the filename but nothing with date modified. I
have users that need to have this in the filename and I am in search of
some help in this matter. Example is a file named test.txt with a date
modified 1/31/2005. I would like the filename to be test
(1/31/2005).txt. Thanks in advance ... Tag: Enable/Disable NIC with a script Tag: 182903
Regexp Matching...
Hi!
On Unix regular expressions work with brackets.
So, when I have a regexp "X([0-9]*)V([0-9]*)Z"
the string "X15V27Z" gives me two matches, one for
each number.
Is there any way to get this in VBScript regular
expressions too?
Lots of Greetings!
Volker Tag: Enable/Disable NIC with a script Tag: 182898
Need help spelling out NULL vs. equal to nothing
Hi All,
Over the past year or so, I've gotten further in to some of the specifics of
VBScript/ASP scripting and I'm having a difficult time getting a definite
answer in regards to searching for an empty or un-occupied string or number.
If anyone is interested in helping, I've listed some of the examples that I
need clarification/correction on:
1) If the value is alphanumeric (VARCHAR), will the following work best?
strValue <> ""
Or
strValue = ""
2) If it is numeric/integer/bit (int, bigint, numeric, etc.), or any other
number-only format, is isNull the correct comparrison?
Not IsNull(intValue)
Or
IsNull(intValue)
3) For the following example, if 'COL1' were part of a recordset that
returned values from other columns, but it itself had no value, would it
still be returned as NULL or as ""?
Dim intNumber
intNumber = 0
If Not IsNull(sp.parameters.item("@COL1").value) Then
intNumber = sp.parameters.item("@COL1").value
End If
If you assign a numeric value as response.cookies("number") or as
session("number") or as a variable="number", then will it maintain it's
original datatype, or does it become string? If it becomes string, does all
conversion have to occur when reading that session variable/cookie, or is
there an alternative?
Anyway, I appreciate the help of anyone wishing to respond.
Thanks,
Curt Morrison
c u r t m o r r i s o n @ y a h o o . c o m Tag: Enable/Disable NIC with a script Tag: 182894
How to deploy a ActiveX Dll to client PCs over the internet
One of my web page uses a ActiveX control a ActiveX DLL. The user PCs
do not have this ActiveX DLL how can I distribute this DLL over the
internet/intranet from the web page.
Please kindly share the code to deploy this ActiveX control to the
client PCs into a ASP page.
If only a .OCX can be deployed how can I convert a Active X dll to a
.OCX I do not have the source code for the Active X dll just the DLL.
Thanks
Karen Tag: Enable/Disable NIC with a script Tag: 182893
Set ACE on OU
The statement below in a vbscript is used to give user da_messerjg Full
Control to an OU in AD - It applies onto 'This object and all child
objects'. I'm trying to find out what AceFlag(s) I need to set to make it
apply onto 'Child objects only'. At the bottom of this post are all of my
constants - I'm not sure if I need to put multiple constants on my AceFlags
line or how to do so.
Any ideas?
Josh Messerschmitt
objAce.Trustee = "DOMAIN\da_messerjg"
objAce.AceFlags = ADS_ACEFLAG_INHERIT_ACE
objAce.AceType = ADS_ACETYPE_ACCESS_ALLOWED
objAce.Flags = ADS_FLAG_OBJECT_TYPE_PRESENT
objAce.ObjectType = SCHEMAIDGUID_OU
objAce.AccessMask = ADS_RIGHT_FULL_CONTROL
objDACL.AddAce objAce
'AccessMask
Const ADS_RIGHT_DS_CREATE_CHILD = &H1
Const ADS_RIGHT_DS_DELETE_CHILD = &H2
Const ADS_RIGHT_ACTRL_DS_LIST = &H4
Const ADS_RIGHT_DS_SELF = &H8
Const ADS_RIGHT_DS_READ_PROP = &H10
Const ADS_RIGHT_DS_WRITE_PROP = &H20
Const ADS_RIGHT_DS_DELETE_TREE = &H40
Const ADS_RIGHT_DS_LIST_OBJECT = &H80
Const ADS_RIGHT_DS_CONTROL_ACCESS = &H100
Const ADS_RIGHT_DELETE = &H10000
Const ADS_RIGHT_READ_CONTROL = &H20000
Const ADS_RIGHT_WRITE_DAC = &H40000
Const ADS_RIGHT_WRITE_OWNER = &H80000
Const ADS_RIGHT_SYNCHRONIZE = &H100000
Const ADS_RIGHT_ACCESS_SYSTEM_SECURITY = &H1000000
Const ADS_RIGHT_GENERIC_ALL = &H10000000
Const ADS_RIGHT_GENERIC_EXECUTE = &H20000000
Const ADS_RIGHT_GENERIC_WRITE = &H40000000
Const ADS_RIGHT_GENERIC_READ = &H80000000
Const ADS_RIGHT_FULL_CONTROL = &HF01FF
'ACE flags
Const ADS_ACEFLAG_INHERIT_ACE = &H2
Const ADS_ACEFLAG_NO_PROPAGATE_INHERIT_ACE = &H4
Const ADS_ACEFLAG_INHERIT_ONLY_ACE = &H8
Const ADS_ACEFLAG_INHERITED_ACE = &H10
Const ADS_ACEFLAG_SUCCESSFUL_ACCESS = &H40
Const ADS_ACEFLAG_FAILED_ACCESS = &H80
'ACE types
Const ADS_ACETYPE_ACCESS_ALLOWED = 0
Const ADS_ACETYPE_ACCESS_DENIED = &H1
Const ADS_ACETYPE_SYSTEM_AUDIT = &H2
Const ADS_ACETYPE_ACCESS_ALLOWED_OBJECT = &H5
Const ADS_ACETYPE_ACCESS_DENIED_OBJECT = &H6
Const ADS_ACETYPE_SYSTEM_AUDIT_OBJECT = &H7 Tag: Enable/Disable NIC with a script Tag: 182886
convert FAT32 to NTFS problem?
Hi, Dear all, i wrote below script, i want to convert remote host Harddisk
format from FAT32 to NTFS, it 's failed in remote hosts, but succeed in
local host. would you please check it for me ? with many thanks !
Regards.
Michael
************************************************************************************************************************
Const Fixed = 2
Const ForReading = 1
Set objOFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = Wscript.CreateObject("WScript.Shell")
Set objTextFile = objOFSO.OpenTextFile("c:\myscript\list.txt",ForReading)
sFile = objOFSO.GetSpecialFolder(2).ShortPath & "\" & objOFSO.GetTempName
ON Error Resume Next
Do while Not objTextFile.AtEndOfStream
strComputer = objTextFile.ReadLine
Set objWMIService = GetObject("winmgmts://"&strComputer)
'Set colLogicalDisk = objWMIService.Instancesof("win32_LogicalDisk")
set colLogicalDisk = objWMIService.ExecQuery("select * from
Win32_LogicalDisk where DriveType= 2")
For Each objLOgicalDisk In colLogicalDisk
IF UCase(ObjLogicalDisk.FileSystem) = "FAT32" Then
sDiskLetter = obiLogicalDisk.DriveLetter
sDiskLabel = objLOgicalDisk.VolumeName
If sDiskLabel = "" Then
sCmd = "%comspec% /c echo y|convert.exe " & sDiskLetter & ":
/fs:ntfs"
Else
Set fFile = objOFSO.CreateTextFile(sFile)
fFile.WriteLine sDiskLabel
fFile.WriteLine "y"
fFile.Close
sCmd = "%comspec% /c convert.exe " & sDiskLetter & ": /fs:ntfs <"&
sFile
End If
oShell.Run sCmd, 0, True
End If
Next
Loop Tag: Enable/Disable NIC with a script Tag: 182885
Script to create scheduled task on remote computers
Hi Guys,
A newbie need some expert help on a script to create scheduled task on
remote computers...
I found one on technet; and edit slightly...
strComputer = InputBox("Machine name","Remote Software Deployment")
Set objService = GetObject("winmgmts:\\" & strComputer)
Set objNewJob = objService.Get("Win32_ScheduledJob")
errJobCreated = objNewJob.Create _
("Monitor.exe", "********123000.000000-420", _
True , 1 OR 4 OR 16, , , JobID)
If Err.Number = 0 Then
Wscript.Echo "New Job ID: " & JobID
Else
Wscript.Echo "An error occurred: " & errJobCreated
End If
Can any one tell me how can I have additonal prompt boxes to allow the
input for:
1. command line
2. the time task scheduled to run
Thanks alot
--
eang18
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: Enable/Disable NIC with a script Tag: 182884
VBScript in Web Page and Security
Hello,
I am still a bit new with writing VBScript in a web page so hopefully
someone can help me with this issue I am having.
I have a management server (MS 2003) in domain USERS, and on this
server I have IIS running with just a simple interface on a web page
right now to help automate an administrative task. However, their are
users that are in the ADMIN domain that will mostly be accessing this
page (along with ones from the USERS domain), however, the users in the
ADMIN domain always get the ADO Security Warning dialog box everytime
the script runs, "The website uses a data provider that may be unsafe.
if you trust this site click OK...", while those users that log into
the USERS domain are fine and do not get this error at all.
How can I supress this dialog box, add code to remedy it, or change
settings on the web server that will fix it. I don't want anyone to
have to actually modify their own PC settings to get this to work
without the warnings.
Thanks,
Ron Tag: Enable/Disable NIC with a script Tag: 182875
Problem with Copying file by DateLastModified vbs
Can someone tell me what I am doing wrong with this, I'm trying to
copy all files by datelastmodified the files can be anything from .doc
.pdf to .dxf .vbs in fact I need to copy everything, that ONLY has been
modified.
I've been scratching my head with this one and I can't see what's
wrong with it.
Here's the code Thanks
function CurrentBackupFolder()
if isArray(BackupFolder) then
CurrentBackupFolder = BackupFolder(WeekdayNumber)
else
CurrentBackupFolder = BackupFolder
end if
end function
function BackupSubFolderName(fldrname)
dim bfldrname
bfldrname = replace(fldrname,":","\")
bfldrname = replace(bfldrname,"\\","\")
BackupSubFolderName = bfldrname
end function
function MakeBackupFolder(fldrname)
dim bfldrname, pbfldrname, fbfldrname
if len(fldrname) = 0 then
MakeBackupFolder = true
exit function
end if
bfldrname = BackupSubFolderName(fldrname)
fbfldrname = fs.BuildPath(CurrentBackupFolder(),bfldrname)
if not fs.FolderExists(fbfldrname) then
pbfldrname = fs.GetParentFolderName(bfldrname)
if not MakeBackupFolder(pbfldrname) then
exit function
end if
fs.CreateFolder(fbfldrname)
end if
MakeBackupFolder = true
end function
function DoThisFile(fl,srcfolder,bpath)
dim bf, res
ON ERROR RESUME NEXT
bpath =
fs.BuildPath(CurrentBackupFolder(),fs.BuildPath(BackupSubFolderName(srcfolder),fl.name))
if BACKUP_ALWAYS then
res = true
elseif not fs.FileExists(bpath) then
res = true
else
set bf = fs.GetFile(bpath)
res = (bf.DateLastModified <> fl.DateLastModified)
set bf = nothing
end if
DoThisFile = res
end function
sub DoBackup(srcfolder)
dim sf, fldr, fl, bpath
ON ERROR RESUME NEXT
if not MakeBackupFolder(srcfolder) then
exit sub
end if
set fldr = fs.GetFolder(srcfolder)
set sf = fldr.SubFolders
for each fl in sf
DoBackup fs.BuildPath(srcfolder,fl.name)
next
set sf = fldr.Files
for each fl in sf
if DoThisFile(fl,srcfolder,bpath) then
WriteLog "Backing up " & fl.path ,false
fl.copy bpath
if err.number <> 0 then
WriteLog "** ERROR ** " & err.number & "; " & err.description,false
CopyErrors = CopyErrors + 1
else
FilesCopied = FilesCopied + 1
BytesCopied = BytesCopied + fl.size
end if
end if
next
end sub
sub ShowResults
dim x
x = "Files copied = " & vbTab & FilesCopied & vbCr & vbLf
x = x & "Bytes copied = " & vbTab & BytesCopied & vbCr & vbLf
x = x & "CopyErrors = " & vbTab & CopyErrors & vbCr & vbLf
x = x & "------------------------------------------------"
WriteLog x,true
if SHOWRESULTS_EOJ then
msgbox x,0,PROGRAMID
end if
end sub Tag: Enable/Disable NIC with a script Tag: 182873
How to run console app with WshShell.Exec without console window?
Hello,
I want to execute console application with WshShell.Exec
method from HTA. However, during execution new console is
created and pops up before my application. Can I run console
process without console window with WshShell.Exec?
Note: I cannot use WshShell.Run since I need access to
process' stdout/stderr streams.
Thanks in advance
Alex Tag: Enable/Disable NIC with a script Tag: 182868
Is a Wait needed
Throught out my script I create and delete files and objects. For
example: I copy a file to a new folder then wait 3 seconds before I
see if the file exists in the new destination. I assume that the
script can run faster than the copy process so the If FileExists can
run before the Copy is complete.
Is this true. Or does the next line not process until the previous has
completed it's process.
Throughout my script I have a total of a minute and 30 seconds in total
waits. Tag: Enable/Disable NIC with a script Tag: 182858
Copy files
Hi everyone.
I need to create a login script that copy a lot of files from a directory
for other.
I've already done one like this but I need to make from a lot of directories
from others.
Here is the script that I'm using now:
fromDir = "c:\1"
toDir = "c:\2"
start = Now()
replaceSize = 0
copySize = 0
deleteSize = 0
noChangeSize = 0
Set fso = CreateObject("Scripting.FileSystemObject")
Set logFile = fso.OpenTextFile("Sincronizacao.log", 8, True)
logFile.WriteLine("")
logFile.WriteLine("Iniciado ................... : " & start)
logFile.WriteLine("Origem ..................... : " & fromDir)
logFile.WriteLine("Destino..................... : " & toDir)
If fso.FolderExists(fromDir) And fso.FolderExists(toDir) Then
Call ReplicateDirectory(fromDir, toDir)
Else
logFile.WriteLine("Erro ...................... : Origem ou Destino
inalcancaveis")
End If
Sub ReplicateDirectory(source, target)
Set targetDir = fso.GetFolder(target)
Set sourceDir = fso.GetFolder(source)
Set targetDirFileList = targetDir.Files
Set sourceDirFileList = sourceDir.Files
Set targetDirFolderList = targetDir.SubFolders
Set sourceDirFolderList = sourceDir.SubFolders
For Each targetFile in targetDirFileList
If fso.FileExists(source & "\" & targetFile.Name) Then
Set sourceFile = fso.GetFile(source & "\" & targetFile.Name)
If targetFile.DateLastModified <> sourceFile.DateLastModified Then
targetFilePath = targetDir.Path & "\" & targetFile.Name
'targetFile.Delete(True)
replaceSize = replaceSize + sourceFile.Size
sourceFile.Copy targetFilePath
Else
noChangeSize = noChangeSize + sourceFile.Size
End If
Else
noChangeSize = noChangeSize + targetFile.Size
'targetFile.Delete()
End If
Next
For Each sourceFile in sourceDirFileList
If Not fso.FileExists(target & "\" & sourceFile.Name) Then
copySize = copySize + sourceFile.Size
sourceFile.Copy targetDir.Path & "\" & sourceFile.Name
End If
Next
'For Each targetFolder in targetDirFolderList
'If Not fso.FolderExists(sourceDir & "\" & targetFolder.Name) Then
'deleteSize = deleteSize + targetFolder.Size
'targetFolder.Delete(True)
'End If
'Next
For Each sourceFolder in sourceDirFolderList
If Not fso.FolderExists(targetDir & "\" & sourceFolder.Name) Then
copySize = copySize + sourceFolder.Size
sourceFolder.Copy(targetDir & "\" & sourceFolder.Name)
Else
Call ReplicateDirectory(sourceFolder.Path, targetDir & "\" &
sourceFolder.Name)
End If
Next
End Sub
finish = Now()
logFile.WriteLine("Arquivos Identicos.......... : " & Round(noChangeSize /
1024 /1024, 1) & " MB")
logFile.WriteLine("Arquivos Apagados........... : " & Round(deleteSize /
1024 /1024, 1) & " MB")
logFile.WriteLine("Sincronizados............... : " & Round(replaceSize /
1024 /1024, 1) & " MB")
logFile.WriteLine("Copiados para o Destino..... : " & Round(copySize / 1024
/1024, 1) & " MB")
logFile.WriteLine("Tempo de execução........... : " & DateDiff("n", start,
finish) & " MIN")
logFile.WriteLine("Total Transferido........... : " & Round((replaceSize +
copySize) / 1024 / 1024, 1) & " MB")
logFile.WriteLine("Finalizado.................. : " & finish)
logFile.Close()
My problem is: Need to sync a lot of Dir's with just one VBS.
Tnks Tag: Enable/Disable NIC with a script Tag: 182853
Using vbscript to set folder permissions and change security settings
Hope this is the right group for this question.
I have an automated installation script that configures servers for our
software installation (which does things like create shares, create windows
user accouts etc etc) - these are run on Windows 2003 server. The script is
actually a "dos" batch file (xxx.bat).
Currently, on Windows 2003 there are three things that I would like to be
able to add to the scripting, which I think I will need to use a xxx.vbs
vbscript file to do. The items I want to be able to script are as follows:
1. Undisable the guest account
2. Change the permissions on a share - specifically add the guest account
and allow all users and all guests to have full access to the share.
3. Change the security on a folder as per the share.
4. Change some of the local/domain security policies - particularly ones
that control password aging, minimum password length etc.
Can anybody point me in the right direction for any/all of the above?
Thanks in advance
Simon Tag: Enable/Disable NIC with a script Tag: 182849
naive question?
I was trying to get the html of the page in my intnet explorer object into a
variable
I tired first
internet = oIE.Document.innerhtml
and I got treated to the message like
not supported
Obviously it would have be easy if there were some sort of clipboard
function to load into variable. I know how to use execwb to get content,
select all etc but that is all useless
I tried sendkeys - did not work
I tired selectall, copy to clipboard, then open notepad and paste and save
with sendkey. that sort of work
However it is vulnerable to error, user could be switching windows and cause
havoc
Any other ways? Tag: Enable/Disable NIC with a script Tag: 182848
VB editor
I find the VB editor in office is very useful.
Can i call it in XP environment (not in office)?
Because i just do some scripts in FSO or Shell?
Thanks a lot.
tony Tag: Enable/Disable NIC with a script Tag: 182836
Collecting sysinfo from remote servers
Hello,
I've been given the task to modify an existing (workable) script that
collects system info of the local server. I would like to run this
script from one central server to remote servers and collect all info
in either a single file or folder on my central server.
The below script works perfectly but I am uncertain to how I can
automate the process of collecting remote server info rather than
performing the mundane process of copying/pasting the file to the
remote server, executing and moving the output file to the central
server. Any help would be appreciated..
*************Script Begin**********************
'******************************************
'SysConfig.vbs
'
' Documents Current System Configuration
'
'******************************************
Option Explicit
Dim SystemSet
Dim System
Dim Service
Dim colServices
Dim colProcessors
Dim Proc
Dim colDiskDrives
Dim Disk
Dim PhysicalMemory
Dim NumofProcs
Dim OpSys
Dim colOpSys
Dim strBootDevice
Dim strSystemDevice
Dim strSystemDirectory
Dim strWindowsDirectory
Dim objBIOS
Dim colBIOS
Dim colNetAdapter
Dim NetAdapter
Dim colNetAdapterConfig
Dim NetAdapterConfig
Dim strIPAddress
Dim strIPSubnet
Dim strDefaultIPGateway
Dim i
Dim CompSysProd
Dim colCompSysProd
Dim Product
Dim colProducts
Dim strProduct
Dim Share
Dim colShares
Dim PageFile
Dim colPageFile
WScript.Echo "Date/Time of Configuration Scan: " & Now
WScript.Echo ""
Set SystemSet = GetObject("winmgmts:").InstancesOf
("Win32_ComputerSystem")
For Each System In SystemSet
WScript.Echo "Hostname: " & System.Caption
WScript.Echo "Domain: " & System.Domain
'WScript.Echo System.SystemType
WScript.Echo "System Memory: " & System.TotalPhysicalMemory
NumofProcs = System.NumberOfProcessors
Next
Set colOpSys = GetObject("winmgmts:").InstancesOf
("Win32_OperatingSystem")
For Each OpSys In colOpSys
WScript.Echo "Operating System: " & OpSys.Caption & " " &
OpSys.CSDVersion & " " & OpSys.Version
WScript.Echo "Boot volume: " & OpSys.BootDevice
WScript.Echo "System volume: " & OpSys.SystemDevice
WScript.Echo "System Directory: " & OpSys.SystemDirectory
WScript.Echo "Windows Directory: " & OpSys.WindowsDirectory
wScript.Echo "Date of system install: " & OpSys.InstallDate
Next
Set colProcessors = GetObject("winmgmts:").InstancesOf
("Win32_Processor")
WScript.Echo "Number of Processors: " & NumofProcs
For Each Proc In colProcessors
'WScript.Echo Proc.SocketDesignation
WScript.Echo "Processor: " & Trim(Proc.Name)
Next
WScript.Echo ""
Set colPageFile = GetObject("winmgmts:").InstancesOf ("Win32_PageFile")
For Each PageFile In colPageFile
'WScript.Echo PageFile.Caption
'WScript.Echo PageFile.CSName
'If PageFile.Description <> PageFile.Caption Then
' WScript.Echo PageFile.Description
'End If
WScript.Echo "Pagefile drive: "& PageFile.Drive
WScript.Echo "Pagefile filename: " & PageFile.FileName
WScript.Echo "Pagefile size: " & PageFile.FileSize
Wscript.Echo "Pagefile name: " & PageFile.Name
Next
WScript.Echo ""
Set colDiskDrives = GetObject("winmgmts:").InstancesOf
("Win32_LogicalDisk")
For Each Disk In colDiskDrives
WScript.Echo ""
WScript.Echo "Disk: " & Disk.Caption & " " & Disk.VolumeName
If Not IsNull(Disk.Size) Then
WScript.Echo "Disk size: " & Disk.Size
End If
Select Case Disk.DriveType
Case 2
WScript.Echo "Drive type: Removable media"
Case 3
WScript.Echo "Drive type: Local Disk"
Case 4
WScript.Echo "Drive type: Network Drive"
Case 5
WScript.Echo "Drive type: CD-ROM"
End Select
If Not IsNull(Disk.FileSystem) Then
WScript.Echo "Disk filesystem: " & Disk.FileSystem
End If
Next
WScript.Echo ""
Set colCompSysProd = GetObject("winmgmts:").InstancesOf
("Win32_ComputerSystemProduct")
For Each CompSysProd In colCompSysProd
WScript.Echo "System model name: " & CompSysProd.Name
'If Not IsNull (CompSysProd.SKUNumber) Then
' WScript.Echo CompSysProd.SKUNumber
'End If
WScript.Echo "System model version: " & CompSysProd.Version
Next
WScript.Echo ""
Set colBIOS = GetObject("winmgmts:").InstancesOf ("Win32_BIOS")
For Each objBIOS In colBIOS
WScript.Echo "System Manufacturer: " & objBIOS.Manufacturer
WScript.Echo "System BIOS version: " & objBIOS.Version
WScript.Echo "System serial number: " & objBIOS.SerialNumber
Next
WScript.Echo ""
WScript.Echo "-----Begin Networking Information-----"
Set colNetAdapter = GetObject("winmgmts:").InstancesOf
("Win32_NetworkAdapter")
For Each NetAdapter In colNetAdapter
WScript.Echo NetAdapter.Caption
WScript.Echo NetAdapter.Manufacturer
If Not IsNull(NetAdapter.AdapterType) Then
WScript.Echo NetAdapter.AdapterType
End If
If Not IsNull(NetAdapter.MACAddress) Then
WScript.Echo NetAdapter.MACAddress
End If
If Not IsNull (NetAdapter.NetworkAddresses) Then
WScript.Echo NetAdapter.NetworkAddresses
End If
WScript.Echo NetAdapter.ProductName
Next
WScript.Echo ""
Set colNetAdapterConfig = GetObject("winmgmts:").InstancesOf
("Win32_NetworkAdapterConfiguration")
For Each NetAdapterConfig In colNetAdapterConfig
WScript.Echo NetAdapterConfig.Caption
If IsArray(NetAdapterConfig.IPAddress) Then
For i = 0 to UBound(NetAdapterConfig.IPAddress)
WScript.Echo NetAdapterConfig.IPAddress(i)
Next
End If
If IsArray(NetAdapterConfig.IPSubnet) Then
For i = 0 to UBound(NetAdapterConfig.IPSubnet)
WScript.Echo NetAdapterConfig.IPSubnet(i)
Next
End If
If IsArray(NetAdapterConfig.DefaultIPGateway) Then
For i = 0 to UBound(NetAdapterConfig.DefaultIPGateway)
WScript.Echo NetAdapterConfig.DefaultIPGateway(i)
Next
End If
If Not IsNull (NetAdapterConfig.MACAddress) Then
WScript.Echo NetAdapterConfig.MACAddress
End If
Next
WScript.Echo "-----End Networking Information-----"
WScript.Echo ""
Set colShares = GetObject("winmgmts:").InstancesOf ("Win32_Share")
For Each Share In colShares
WScript.Echo ""
WScript.Echo "Share name: " & Share.Name
WScript.Echo "Share caption: " & Share.Caption
If Share.Description <> Share.Caption Then
WScript.Echo "Share description: " & Share.Description
End If
WScript.Echo "Share path: " & Share.Path
'Debug
' WScript.Echo Share.Type
'End Debug
Select Case Share.Type
Case 0
WScript.Echo "Share type: " & "Disk Drive"
Case 1
WScript.Echo "Share type: " & "Print Queue"
Case 2
WScript.Echo "Share type: " & "Device"
Case 3
WScript.Echo "Share type: " & "IPC"
Case -2147483648
WScript.Echo "Share type: " & "Disk Drive Admin"
Case -2147483649
WScript.Echo "Share type: " & "Print Queue Admin"
Case -2147483650
WScript.Echo "Share type: " & "Device Admin"
Case -2147483645
WScript.Echo "Share type: " & "IPC Admin"
End Select
Next
WScript.Echo ""
Set colProducts = GetObject("winmgmts:").InstancesOf ("Win32_Product")
For Each Product In colProducts
WScript.Echo ""
WScript.Echo "Product name: " & Product.Name
WScript.Echo "Product version: " & Product.Version
If Not IsNull (Product.Vendor) Then
WScript.Echo "Product vendor: " & Product.Vendor
Else
WScript.Echo "<no product vendor information>"
End If
Next
WScript.Echo ""
Set colServices = GetObject("winmgmts:").InstancesOf ("win32_service")
For Each Service In colServices
WScript.Echo ""
WScript.Echo "Service: " & Service.Caption
If Not IsNull (Service.Description) Then
WScript.Echo Service.Description
Else
WScript.Echo "<no service description>"
End If
WScript.Echo " Executable: ", Service.PathName
WScript.Echo " Status: ", Service.Status
WScript.Echo " State: ", Service.State
WScript.Echo " Start Mode: ", Service.StartMode
Wscript.Echo " Start Name: ", Service.StartName
Next
WScript.Echo ""
************Script End***************** Tag: Enable/Disable NIC with a script Tag: 182832
how to show the html code that the WebBrowser want to save when he
how to show the html code that the WebBrowser want to save when he want to
save html+pictures with the "dialogbox" - before saving.
this is the code to open the save "dialogbox"
Me.WebBrowser1.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER, 0, 0
this is not good for me:
Text1.Text = WebBrowser1.Document.documentElement.OuterHTML Tag: Enable/Disable NIC with a script Tag: 182831
Loop through checkboxes
Good evening,
I apologize if this message gets posted twice, my webbrowser behaved
strangely when posting.
I am having trouble with the following code:
******
For j = 1 to NoChkBx
If Checkbox(j).checked Then
msgbox j
End If
Next
******
The issue is with the synthax for the 2nd line "If Checkbox(j).checked
Then"? What is the proper way with dealing with a variable in a control name?
Thank you for the help,
Daniel Tag: Enable/Disable NIC with a script Tag: 182823
Script to automate SSID wireless
This is a multi-part message in MIME format.
------=_NextPart_000_0026_01C5DFC3.0C1337D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Is it possible to automate the setup of a wireless connection with the =
settings we need for our network.=20
SSID (XXXXXXXXXXX)
PEAP authentication
NOT validating server certificates
MSCHAP (Windows username and password).
WEP enabled
key is provided
--=20
SHANE CLARK
------=_NextPart_000_0026_01C5DFC3.0C1337D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1516" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Is it possible to automate =
the setup of a=20
wireless connection with the settings we need for our network.=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>SSID (XXXXXXXXXXX)</FONT></DIV>
<DIV><FONT size=3D2>PEAP authentication</FONT></DIV>
<DIV><FONT color=3D#000000><B><FONT color=3D#0000ff><FONT =
color=3D#000000=20
size=3D2>NOT</FONT></B><FONT color=3D#000000 size=3D2> validating server =
certificates</FONT></FONT></FONT></DIV>
<DIV><FONT color=3D#0000ff><FONT color=3D#000000 size=3D2>MSCHAP =
(Windows username and=20
password).</FONT></FONT></DIV>
<DIV><FONT color=3D#0000ff><FONT color=3D#000000 size=3D2>WEP=20
enabled</FONT></FONT></DIV>
<DIV><FONT color=3D#0000ff><FONT color=3D#000000><FONT =
color=3D#0000ff><FONT=20
color=3D#000000 size=3D2>key is =
provided</FONT></DIV></FONT></FONT></FONT>
<DIV><FONT color=3D#000000><FONT color=3D#0000ff><FONT color=3D#000000=20
size=3D2></FONT> </DIV></FONT></FONT>
<DIV><FONT face=3DArial size=3D2><BR>-- <BR>SHANE =
CLARK</FONT></DIV></BODY></HTML>
------=_NextPart_000_0026_01C5DFC3.0C1337D0-- Tag: Enable/Disable NIC with a script Tag: 182821
synthax error?
Good afternoon,
I have the following entry as part of an HTA:
UserInputHTML = UserInputHTML & "<select size=" & chr(34) & "1" & chr(34) &
" name=" & chr(34) & "GrpListing" & chr(34) & " onChange=" & chr(34) &
"EnumGrpMbr(GrpListing.Value , strComputer)" & chr(34) & ">" & vbCrLf
However, this generates an error "Cannot use parenthesis when calling a
Sub". How can I fix this. I have tried different things but have not
managed to get it functional. The problem to my knowledge is with the
"EnumGrpMbr(GrpListing.Value , strComputer)" . When I have only 1 variable
to transfer to my sub it works fine, but when I tried to send 2 it gives me
this error. What is the proper synthax?
Thank you in advance!
Daniel Tag: Enable/Disable NIC with a script Tag: 182813
Parse xml file in vbscript
Hello all,
I need to parse and xml file check whether a certain condition is true. In
xml file, there is a commented out example, but still contains the text that
I will be parsing.
Any suggestions on:
1) How to parse an xml file in vbscript in general
2) How to bypass the comments in the xml file
would be greatly appreciated!
Thank you in advance! Tag: Enable/Disable NIC with a script Tag: 182809
User Credentials
Hello,
Is there a way with vbscript to reinitialize a user's credentials.
Basically, when the Admin changes a users permissions on the main server, the
user must logout and the back in for the changes to take effect. Is there a
way using a simple script that it can go and update the current user's
credentials without requiring logging out?
Thank you,
Daniel Tag: Enable/Disable NIC with a script Tag: 182807
Executing a vbs script from an asp.net page
Thanks in advance.
I know I have to impersonate a valid account and am doing so for folder
creation but want to launch a vbs script with some parms to handle some
permission changes (since that script already works).
I do not know how to execute the script from the code behind.
I am using the 1.1 framework and c#. Tag: Enable/Disable NIC with a script Tag: 182803
Close all IE windows at once
I frequently end up with so many Internet Explorers open, that it would
be useful to have a means of closing all IE windows in one step. Anyone
know of a windows script (or maybe a .bat file) that could do this?
Thanks
Larry Tag: Enable/Disable NIC with a script Tag: 182802
FileSystemObject problems
This is a query to do with classic ASP (written through vbscript).
I am trying to run an asp page on my local Windows 2000 machine which
creates a folder in the root directory of my site, but when I run the page it
simply hangs when it gets to the FileSystemObject folder creation part
(when I remove this line of code, the rest of the page works fine)
The code is fine because it is working on the live server, so the
problem is with the PERMISSIONS on my local Windows 2000 server.
I've set ALL folders from wwwroot upwards with FULL rwx access for ALL
users.. plus I've added the IUSR_(machinename) to this list with full
access. I've did this through Explorer.
I've run out of ideas on where else to set permissions... anyone got any
ideas??
Thanks!
Peter
--
"I hear ma train a comin'
... hear freedom comin" Tag: Enable/Disable NIC with a script Tag: 182800
trying to achieve automation, need assistance
I have created a deployment script to automate desktop deployment. I have
enabled autologon using the local administrator account... But I am trying to
figure out the best way to get the script to run at startup...
Now, I know vbscript has a GPO interface but I have no idea how I would
disable the deployment.vbs script from running at logon. I could put the
script in the startup folder, but how would I remove it automatically? I
couldn't delete the script while the script is running could i?
Any thoughts? Tag: Enable/Disable NIC with a script Tag: 182798
DateAdd Bug?
Small VBS to demonstrate an issue I have with the VBS DateAdd function:
msgbox CDate("23/10/2005 22:15:00") = DateAdd("h", 22, DateAdd("n", 15,
CDate("23/10/2005")))
This pops up a message box with False in it.
Any suggestion as to why?
This returns true:
msgbox CDate("23/10/2005 22:15:00") = CDate(CStr(DateAdd("h", 22,
DateAdd("n", 15, CDate("23/10/2005")))
(UK Locale!) Tag: Enable/Disable NIC with a script Tag: 182793
70 permission denied in upload file
I have a web application in asp that have to upload files.
If I put the upload directory into C:\ directory I have no problem, but
if I put it into the C:\InetPub\wwwroot directory it give me the error
in the subject.
I've set all the permissions on the upload directory (read, write,
execute, ecc.) and also on the wwwroot directory, but evidently there is
some permission that stop the writing of the uploaded file.
I've also attempt to share the directory both as web share that as net
share, but nothing to do.
I have Win XP with IIS 5.1.
Someone can help me?
Thanks
Tonio Tanzi Tag: Enable/Disable NIC with a script Tag: 182792
sending an email of log file that is created in new folder each time
Hello,
I am new to this forum and to scripting, and was hoping I could find
some help.
I want to email off a log file that is created each week. It puts the
report into the following path (and the html log file name is always
random):
c:\Nov2005\Week1\log0011029273.html
The month and week folders are created new each week, so I cant use a
static file location.
I have the following script that works fine for static files:
--------------------------------------------
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.Sender = "sc@co.com"
objMessage.To = "sc@co.com"
objMessage.TextBody = "This is some sample message text."
objMessage.AddAttachment "c:\Nov2005\Week1\log0011029273.html"
'==This section provides the configuration information for the remote
SMTP server.
'==Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.co.com"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
-----------------------------------------------------------
..but every time this report is run, it creates a new path to the new
report file...so this has to be the current
C:\month\week\randomlogfilename.html
Any help in constructing this would be much appreciated.
--
sc48226
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------ Tag: Enable/Disable NIC with a script Tag: 182785
error connecting to Active Directory via LDAP from ASP/VBScript pg
I'm rather new to the world of VBScript/ASP. I'm a *nix-head and have
been programming in PHP for years. I'm rather frustrated because I do
not know how to go about trouble-shooting an error I'm receiving in a
script I'm trying to implement to authenticate a user against AD.
The script is as follows (found it in these usenet groups):
<%@ Language=VBScript %>
<%
Dim username, password, ldapserver, ldap_path
' Construct the FQDN
ldap_path = "LDAP://cn=##,DC=ourcollege,DC=edu"
' Get the ldap server name into local variable by replacing the special
' charcter with the username
ldapserver = Replace(ldap_path,"##",Request.Form("username"))
Response.Write("<b>username:</b> " & Request.Form("username") & "<br
/>")
Response.Write("<b>ldapserver:</b> " & ldapserver & "<br />")
' Parse the username from the ldap path
username = Mid(ldapserver, InStr(8, ldapserver, "/") + 1)
Response.Write("<b>username:</b> " & username & "<br />")
' Get the password
Password = Request.Form("Password")
' Connect to the LDAP Directory
Set dso = GetObject("LDAP:")
' Validate the User Name and Password
Set objUser = dso.OpenDSObject(ldapserver, username, password, 0)
'Response.Write("<b>lobjuser.class:</b> " & lobjUser.class & "<br />")
'Response.Write("<b>err.description:</b> " & err.description & "<br
/>")
' Exit with error - Incorrect username & password - return to login.asp
page
'If Err.number<>0 Then
' Response.Write "<b>Result:</b> Authentication Failure.<br />"
' Set lobjUser = nothing
' Set dso = nothing
'Else
' Response.Write "<b>Result:</b> Success.<br />"
'End If
'To get information from the LDAP directory you need to know the
"attributes"
'available and then you can reference them. Ex:
'strUserName = lobjUser.Get("cn")>
%>
The above code generates the very unhelpful error:
error '8007054b'
/ldap_auth_02.asp, line 29
Is there a system log which will give me more information on the error
which occured? Is there something I can response.write to my browser
which might give me a more useful error message?
I recently put together a PHP script to connect to AD via LDAP. I had
to bind to AD using a username (RDN?) and password before I could
perform a query. (I apologize if I'm not using the appropriate
terminology.) I then passed AD our Base DN, filter, and search terms.
I can't find any documentation on this. My ultimate goal is to
authenticate a user with their AD credentials. Tag: Enable/Disable NIC with a script Tag: 182783
SCSI Adapter Port Number
Hi,
Anyone know how to get the SCSI port number of a SCSI host adapter using
vbscript?
I can get the SCSIPort property of a disk object using WMI but there doesn't
seem to be a port number property for the HBA.
Please let me know if you would like more information,
Much appreciated,
Joe Marriott Tag: Enable/Disable NIC with a script Tag: 182782
Hide/Show HTML Elements
Hi, I would like to show a status label above all other HTML elements
when a certain function is fired. (for example: "Calculating..."
I tried playing with .zIndex, .Display="none" and .Visible properties
but none of the seem to be working for [web forms label] or Iframe (I
use IFRAME to show label above ActiveX control)
What is the easiest way for me to show hide information/status labels
on a web form?
document.getElementById("lblInfo").????
Thank you,
Sergey Tag: Enable/Disable NIC with a script Tag: 182778
Server.CreateObject Excel permissions
Hello All
I am trying to port some ASP code over to a windows 2003 server.
It works fine on my "dev" windows 2000 server.
I get this error on the 2003 server:
Error Type:
Server object, ASP 0178 (0x80070005)
The call to Server.CreateObject failed while checking permissions. Access is
denied to this object.
Here is the line of code associated with the error:
set objExcel = Server.CreateObject("Excel.Application")
I have Excel 2000 installed on both machines.
From what I can tell I have set permissions the same on both machines.
I set and checked the permissions on the actually Excel.exe file is that the
correct file that CreateObject uses? What else should I be checking/setting
permissions on so that this will work on the 2003 server?
Thanks in advance.
Adam Tag: Enable/Disable NIC with a script Tag: 182776
VBS to .net
I just started working with .net and I'm wanting to know how hard it is
to convert a .vbs to .net? The scirpt is a basic script that is 2
msgboxes and requires input from the user on both promts then it copies
the results to the clipboard. Tag: Enable/Disable NIC with a script Tag: 182775
Query for Patches Applied
I need a query that will run and send to text all of the patches applied to a
server or workstation. I have one now, however, it doesn't give me the full
history like when you click on history on the windows update site. And it
does not tell me that XP SP2 was installed, when it actually was.
I can share the code to my current script if needed.
Thanks! Tag: Enable/Disable NIC with a script Tag: 182774
check membershipt to group using input boxes. Isn't binding corre
strFilePath = "c:\test.txt"
errorlog = "c:\error.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objtextFile = objFSO.OpenTextFile (strFilePath)
Set objFile = objFSO.CreateTextFile(errorlog, True)
' On Error Resume Next ' moved this out of the Do loop
objgroup = inputbox("Type group here")
objuser = inputbox("type local user here")
Do Until objtextFile.AtEndOfStream
Set grp = GetObject("WinNT://" & strcomputer & "/" & objgroup & ",group")
Set usr = GetObject("WinNT://" & strcomputer & "/" & objuser & ",user")
strComputer = Trim(objtextFile.ReadLine)
if len(strComputer) <> 0 then
If (grp.IsMember(usr.name)) Then
objFile.Writeline now & " user " &objuser & " is member of " &
objgroup & " on " & strComputer
Else
objFile.Writeline now & " user " & objuser & " isn't member of " &
objgroup & " on " & strComputer
End If
err.clear
end if
loop
objFile.Close
objTextFile.close
result = objfso.OpenTextFile(errorlog, 1).ReadAll
wscript.echo result Tag: Enable/Disable NIC with a script Tag: 182772
Startup script, alternative to %LogonServer%?
I wish to copy a file from the Netlogon share within a startup script,
however, I cannot use the %LogonServer% variable in a startup script (not
logon script). Is there an equivilant variable? I could specify a specific
DC, but as we have a number of sites I would prefer using the DC server that
it is running the script from.
Windows Server 2003 SP1
Windows XP Professional SP2 Tag: Enable/Disable NIC with a script Tag: 182759
I need to be able to Enable or disable one of the network adaptors in a
server on the fly as part of a failover senario.