catch a field's value before and after it is updated
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01C46D9D.ECEF3810
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I'm trying to figure out a way to write a field's before and after =
update values to a text field on a customized Contact form.
I've got the Item_PropertyChange event catching the name and value of =
the field after it's changed. And I've got writing to the text field =
working. I'm used to the item.OldValue property that's available in an =
Outlook form. But this doesn't seem to be a property of a field from =
vbscript.
The best I can see is that I could capture the values of each of the =
fields I'm interested in into a module variable on the item's Item_Open =
or Item_Read event, then build a case statement in the =
Item_PropertyChange event.
Anyone got any simpler approaches?
------=_NextPart_000_0008_01C46D9D.ECEF3810
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.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I'm trying to figure out a way to write =
a field's=20
before and after update values to a text field on a customized Contact=20
form.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I've got the Item_PropertyChange event =
catching the=20
name and value of the field after it's changed. And I've got writing to =
the text=20
field working. I'm used to the item.OldValue property that's available =
in an=20
Outlook form. But this doesn't seem to be a property of a field from=20
vbscript.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The best I can see is that I could =
capture the=20
values of each of the fields I'm interested in into a module =
variable on=20
the item's Item_Open or Item_Read event, then build a case =
statement=20
in the Item_PropertyChange event.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Anyone got any simpler=20
approaches?</FONT></DIV></BODY></HTML>
------=_NextPart_000_0008_01C46D9D.ECEF3810-- Tag: Listing duplicate machines in AD Tag: 160738
Event Log Management
I would like to write a script that dumps the Security event log to a file
called %machine%_%date%_Security.txt and then clears the event log. I am
successfull in dumping the log but I have been unsuccessful in clearing the
event log; Anyone have a sample that shows how to save them clear a given
log?
Thanks Tag: Listing duplicate machines in AD Tag: 160729
Schedule ASP page
Hello, all. We need to schedule an ASP page to run hourly/daily, which
generates a static HTML (*.htm) page. Is this possible with VBS? If so, are
there any examples out there? Thank you much. Tag: Listing duplicate machines in AD Tag: 160728
Map Printers with login script
I am looking for a way to map users printers at login. We have an AD
environment and I want to push this out using a group policy. Does anyone
have any pointers on how I can do this.
Thanks
Gavin... Tag: Listing duplicate machines in AD Tag: 160727
unlock machine programmatically
Hello there
is there a way to unlock a machine programmatically ?
same as using rundll32.exe user32.dll,LockWorkStation for lock it?
Regards
Sameh Tag: Listing duplicate machines in AD Tag: 160726
DatePart not working completely
I have a DTS in Microsoft SQL Server in which I am writing an ActiveX Script
Task using VB Script Language.
I need to build a string for current date and time in this format :
YYYYMMDDHHMMSS. So I wrote this code :
Dim v_CurrentDate
Dim v_DateString
v_CurrentDate = Date
DateString = DatePart ( "yyyy", v_CurrentDate ) & _
Right ( "0" & DatePart ("m", v_CurrentDate), 2 ) & _
Right ( "0" & DatePart ("d", v_CurrentDate), 2 ) & _
Right ( "0" & DatePart ("h", v_CurrentDate), 2 ) & _
Right ( "0" & DatePart ("n", v_CurrentDate), 2 ) & _
Right ( "0" & DatePart ("s", v_CurrentDate), 2 )
But the above code is only working correctly for year, month and day part
but not the hours, month and seconds. The result I am getting is :
DateString = 20040719000000
My question is why hours, month and seconds are being returned as 000000?
What mistake I am making here?
Thanks Tag: Listing duplicate machines in AD Tag: 160725
Install setup.exe with silent install switch -s -f1\\setup.iss
I'm having a bear of a time figuring this out.
I need to install Thinprint which is a program used with Citrix to solve
printing issues. They do not provide a .msi file so I use a setup.exe with
a silent install script recorded as setup.iss.
I have tried for 3 days to get this working to deploy to all my domain's
PCs.
My company use to have every as a domain admin so that they would have local
admin rights. WSe'll, when I was hired I removed domain admin rights and
made them just local user permissions on PCs. Now this is the first big
software rollout and I look like an idiot. I can't get the setup.exe to
run.
I have a login script were it work, but only if they are a local admin. If
they aren't, the msiexec.exe and setup run in task manager but it just sits
there for hours.
This weekend I tried the GPO startup to get it to run as the system account.
I still have the same issues.
I tried .bat, .vbs, .whs and I just can't get it to work.
I have the install and silent install file on a public drive which users map
H: to. So this is the command I try to run.
H:\setup -s -f1h:\setup.iss
I have also tried unc.
\\server\public\setup -s -f1\\server\public\setup.iss
I have used runas and psexec to run with admin permissions. I must be doing
the command line wrong or something. I programed a little delphi .exe
program to run the command. It works but with only if admin rights on the
PC.
Can someone hold my hand and actually give me the code or examples? I
searched google for hours doing research to run my script 100 different
ways. Non work. I've got to be missing something very simple. Tag: Listing duplicate machines in AD Tag: 160724
LDAP Script
Does anyone know of/have a script that can be used in a web page for users
to change their own GAL details using LDAP? Tag: Listing duplicate machines in AD Tag: 160721
Internet Connection Check
This has probably been asked before but anyway, Is it possible, using
VBScript, to check whether a connection to the internet is connected? Also,
what is the best way to start a connection to the internet using VBScript?
Thanks in advance!!! Tag: Listing duplicate machines in AD Tag: 160716
Event Logs Backup ans save
Hello. Using some of the scripts from Microsoft Technet I
am able to clear and backup the event logs on server then
copy them to a folder on a remote share. This is ok but
to run this script on other servers I would need to edit
the script each time by putting in the server name. I
would like the server event logs to backup to a folder
the same as the computer name ie: "Server A" would backup
to a folder on the remote share called "Server A". I
would like this to happen without having to put the
computer name into the script, so that if the script is
run on "server A" then it would create and backup to a
folder called "Server A" on the remote share. I really
hope this makes sense. Here is the script.
dtmThisDay = Day(Now)
dtmThisMonth = Month(Now)
dtmThisYear = Year(Now)
strBackupName = dtmThisYear & "_" & dtmThisMonth & "_" &
dtmThisDay
strComputer = "SERVER A"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Backup)}!\\" & _
strComputer & "\root\cimv2")
Set colLogFiles = objWMIService.ExecQuery _
("Select * from Win32_NTEventLogFile where
LogFileName='system'")
For Each objLogfile in colLogFiles
objLogFile.BackupEventLog ("c:\Install\Event Logs\" &
strBackupName & _
"_system.evt")
objlogFile.ClearEventLog()
Const OverwriteExisting = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\Install\Event
Logs\*.*" , "\\remoteserver\elogs$\ServerA\" ,
OverwriteExisting
Next Tag: Listing duplicate machines in AD Tag: 160714
CDO, MAPI VBScript just stops
Hi
I have a VBSCRIPT which scans through a Public folder called
AUTO-RESPONSE. Under AUTO-RESPONSE, there are 20 or so Sub folders
with POSTS in them. Each item as a User-Defined Folder variable called
DAYS.
I have three scripts. The first one increments the DAYS value by one
each day. There are probably 7000 items which it updates in 5
minutes.. No problems here.
The other two scripts run at each day and looks for 3 day or 6 day
items, then sends an email to the recipient, then if it is a 6 day
email, deletes the email.
Ok... both scripts are exactly the same, except the 3 or 6 day check
and the message delete. Both scripts behave the same. That is:
They start processing, looking at each subfolder and if it finds the
3/6 in the DAYS field processes the message. This works fine for a
short time, then the script just stops as though it has finished. The
script is not hanging, the wscript just disappears from the w2k
process list. It seems to have only prcessed about 20 mail items,
sometimes 50, but always less than 60. If I run the script again (say
for the 6 day which has deleted the previous emails as required) it
starts where it "left off" in the previous run, might go 10, 20 items
then again disappears/stops.
I have a debug log being written at every crucial area that could
cause an error, but an error is never generated.
Has anyone seen this behaviour? I have included the whole subroutine
for your scrutinization.. (Variables not defined in the sub are Global
Vars and have the correct valuse loaded before calling the routine.) I
hope that you can either see the issue,or offer a better way of doing
the process...
Thanks Robert
Sub DoSubFolders
Dim nLoop
Dim iLoop
'Loop through each folder, check it has a * in the first column and
process each message.
for nLoop = 1 to objFolder.Folders.count
set objSubFolder = objFolder.Folders(nLoop)
if err.number <> 0 then
' Write debug info
If blnLogFileOpen = True Then
objFile.WriteLine "Folder error (" & objSubFolder.name & ") -
Error: " & err.Description
End If
end if
err.Clear
if left(objSubFolder.name,1) = "*" then
' Write debug info
If blnLogFileOpen = True Then
objFile.WriteLine "Folder: " & objSubFolder.name & ", messages to
check: " & objSubFolder.Messages.count
End If
'Find All messages in the Folder and send response to recipient
if objSubFolder.Messages.count > 0 then
set objMessages = objSubFolder.Messages
For iloop = 1 to objMessages.count
err.Clear
numDays = 0
Set objMessage = objMessages.Item(iLoop)
set objFields = objMessage.fields
if err.number <> 0 then
' Write debug info
If blnLogFileOpen = True Then
objFile.WriteLine " Message Field Error - Error: " &
err.Description
End If
end if
err.Clear
set objField = objFields.item("Days")
numDays = cint(objField)
if err.number <> 0 then
' Write debug info
If blnLogFileOpen = True Then
objFile.WriteLine " NumDays Error - Error: " &
err.Description
End If
end if
err.clear
'If numDays = 6 then we need to send the email
if numDays = 6 then
Set objSMail = CreateObject("Redemption.SafeMailItem")
objSMail.Item = objMessage
strType = objSMail.Fields(PR_SENDER_ADDRTYPE)
Set objSenderAE = objSMail.Sender
If Not objSenderAE Is Nothing Then
If strType = "SMTP" Then
mailTO = objSenderAE.Address
ElseIf strType = "EX" Then
mailTO = objSenderAE.Fields(PR_EMAIL)
End If
mailSUB = objsMail.Subject
End If
Set objSenderAE = Nothing
Set objSMail = Nothing
if err.number <> 0 then
' Write debug info
If blnLogFileOpen = True Then
objFile.WriteLine " Message Error - Error: " &
err.Description
End If
end if
err.Clear
'OK.. Got Email Body, send email
set objMail = CreateObject("CDONTS.NewMail")
objMail.BodyFormat=1
objMail.MailFormat=0
objMail.To = mailTO
objMail.From = mailFROM
objMail.Subject = mailSUB
objMail.Body = MailBody
objMail.Send
set objmail = nothing
if err.number <> 0 then
' Write debug info
If blnLogFileOpen = True Then
objFile.WriteLine " Send Message Error - Error: " &
err.Description
End If
else
' Write debug info
If blnLogFileOpen = True Then
objFile.WriteLine " Email sent to: " & mailTo & ", Subject:
" & mailSUB
End If
end if
'Delete Mail Message
objMessage.delete
if err.number = 0 then
If blnLogFileOpen = True Then
objFile.WriteLine " 6 Day Email deleted"
End If
else
If blnLogFileOpen = True Then
objFile.WriteLine " Could not delete email. Err: " &
err.Description
End If
end if
err.Clear
Set objMessage = nothing
set objFields = nothing
set objField = nothing
err.Clear
end if
Next
end if
end if
next
End Sub Tag: Listing duplicate machines in AD Tag: 160713
"generic" code to retrieve any type of WMI info - possible in VBScript?
Hello all--
After a few hours of playing around ... and many, many hours of
searching ... I am not able to find an answer to my problem -- so I'm
hoping that the bright minds here might be able to help.
I'm working on a project to monitor various components of our
enterprise network via WMI. Being that VBScript/ASP are my primary
programming skills these days, I was planning on writing an interface
in ASP that would write items to an Access or SQL database, and then a
VBScript process which could query the database and submit WMI lookups
against hosts and log the data returned.
I know how to do all of the pieces required except one -- making a WMI
query mechanism that is "generic" enough to handle any type of data I
might want to retrieve (or at least typical sets such as numeric,
string, boolean, etc.) The problem that I have, is that the values
must be called specifically depending on what the data is. So, for
instance, if I want to get the temperature out of the system I have to
specifically call the ".CurrentTemperature" property within the code.
For example....
strComputer = "localhost"
set wbemServices = GetObject("winmgmts:\\" & strComputer &
"\root\wmi")
set wbemObjectSet =
wbemServices.InstancesOf("MSAcpi_ThermalZoneTemperature")
For Each wbemObject In wbemObjectSet
WScript.Echo "InstanceName : " & wbemObject.InstanceName
WScript.Echo "Current Temperature: " &
wbemObject.CurrentTemperature
Next
This works great - but it's just not generic for the several hundred
types of queries I can imagine running. I can't define a variable of
"CurrentTemperature" and call it at the end of the wbemObject. - it
just doesn't work that way (nor did I expect it would). Therefore, I
need something generic. I want to be able to create an Access
database record which would simply define the object set
(MSAcpi_ThermalZoneTemperature) and the property within that set
(CurrentTemperature) to check, and then handle that with generic
variables which can then post the data to Access, analyze it for
violating a threshold, etc.
(Apologies if I don't have the lingo quite right - I haven't actually
"officially" been a programmer for over a decade)
Hopefully I've gotten my point across and you might understand where
I'm headed with this. I'd moat likely make the framework an
open-source project as a simple and easy-to use network monitoring
system.
Thanks in advance!
-Douglas Toombs Tag: Listing duplicate machines in AD Tag: 160705
writing to an .ics file
How can I write to an .ics file in this format. It is pulling
information from a database
FirstName:John
LastName:Doe
City:Philadelphia
State:PA
ZipCode:19104
FirstName:Jane
LastName:Dorris
City:Lakewood
State:NJ
ZipCode:08701 Tag: Listing duplicate machines in AD Tag: 160703
A few questions for you VBScript Gurus!!!
Hello All,
I am new to VBScript and was hoping for some pointers. Basically, I created
a DOS batch file at work that allows us to install several software packages
in order after we tell it which drive to launch the packages from. The DOS
batch file works like a dream, however, I would like to use VBScript to take
this to the next level. I have figured out how to do certain things like
display system specs and stuff like that, but some of the basic concepts are
giving me problems. Here are the questions I have:
1. After setting up an Input Box that has the buttons OK and Cancel, how
can I program the script to exit the program if the button Cancel is
pressed? As it stands right now, regardless if the OK or Cancel button is
pressed, the script will carry on to the next line of code.
2. In the DOS batch file, I was easily able to set up labels and tell DOS
if a certain condition was met, goto label, If condition wasn't met goto
this label. Basically, I was easily able to direct my script to jump to
different parts of my code just by using the goto xxxx. Can I do this in
VBScript? Right now, it seems like the Select Case and Do Loops just
doesn't fit my needs but that is probably because I don't know how to use
them properly for what I am trying to do.
3. I am currently using NotePad to develop my scripts and it is ok for the
most part. However, if I run the program and receive an error in line 77, I
have to count all the way down just to find out the line. Please tell me
there is a better way! Right now I have decided to break my code down into
sections and run one part at a time in seperate scripts just to see if it
works.
4. Is there a way that I can display colored text in a message box? The
goal is to have the system specs displayed and if any part of the system
specs doesn't meet my software requirements, then I want it to display
additional text (that is red) pointing this out.
Any help or advise would be appreciated. Thanks in advance! Tag: Listing duplicate machines in AD Tag: 160699
HELP: Mapping Network Drives and Trapping Errors to Return Success
Hello,
I wonder if anyone can help me. I want to be able to use VBScript as
part of a logon script to map a network drive and to return a error on
the basis of weather the mapping was successful or not.
Does anyone know how to do this?
I'm using the MapNetworkDrive function of the WScript.Network object to
do the mapping.
I've enabled "On Error Return Next" and getting the value in Err.Number
however I do not know what codes are returned on success or failure.
Any ideas?
If i can't map drives
Hardeep. Tag: Listing duplicate machines in AD Tag: 160696
Cannot use win word in IE
Dear all,
I try to write a vbscript to open the word2000 in IE from some clients'
computers; however, IE always report the error "The client has refused this
request" from the line "set abc = createobject("Word.Application")" . I
have checked the Task Manager and I found that the word has been called in
the task manager. Can anyone help me to solve this problem? Thank you for
all of your help. Thank you.
Alex Tag: Listing duplicate machines in AD Tag: 160693
Variable redefine
Hi everybody,
In an ASP page, I need to load twice an include file that contains
variables. So I get an error message "variable redefine" I tried to test
with VarType before to define the variable (dim) with no success. Is it
faisable with VBScript to define a variable (dim) under condition.
' this code gives an error
if VarType("MyVar") = vbNull then
dim MyVar
end if
many thank's
serge Tag: Listing duplicate machines in AD Tag: 160692
Accessing WSH objects from within IE
The code works fine in the W2K pro environment but why won't it work within
a web page. I keep getting a cannot create object error. Is there a
workaround so you can access Active Directory from within IE6?
Thanks,
Jim
Option Explicit
Dim oNetwork, UserName
Set oNetwork = CreateObject("WScript.Network")
username = oNetwork.username
MsgBox username Tag: Listing duplicate machines in AD Tag: 160690
VBS Logoff disconnected user
This must have been asked before, but I can't find it in groups, the
web, or msdn. Is there a way to log off a disconnected user (XP via
fast user switching) through .vbs? I can logout the currently logged
in and active user, but I want to log out everyone who isn't running a
console session. Any idea?
Josh Tag: Listing duplicate machines in AD Tag: 160689
Frame="All" Not Working
I have taken over a Web Site. The Default Page is in two frames. When I go to display the page below, it will not display as a full page (or frame). Been at this four days and for the life of me I do not know what is wrong. This works with two other pages, but not this one!
<Html>
<Head>
<Title> Information for Parents </Title>
</Head>
<Form Name="Default" Method="GET" Action="../Default.htm">
<Body bgcolor="#FFFFFF">
<Font Face="Courier New" size="3"><Strong>
<Center>
<Table Border="3" Frame="All" CellPadding="1" CellSpacing="2">
<Caption Align="Top"><B>Parents</B></Caption>
<tr>
<td>Parents
want the best education for their children. We understand that each school community has
its unique needs. Our goal is to provide your family with a positive learning environment,
the finest educational programs, and services that promote outstanding student
achievement.
Parents are children's first and life-long teachers. We value the partnership between home
and school and recognize that parental involvement is the key to success in school. You can
be involved by helping your child with homework, volunteering in our schools, or joining a
school council. By welcoming and providing opportunities for you to be involved, we can
work together to ensure that children receive the very best education.<BR></font></td></Tr>
<BR>
</Table>
<A Href="../Hatch.htm">RETURN</A>
</Form>
</Body>
</Html>
Any help would be greatly appreciated.
Thank You in Advance
Len Tag: Listing duplicate machines in AD Tag: 160687
Will Not Display Page as Full Frame
The Web Site I am taking over is split into two frames.
The code below will not display as a full Page (Frame). This works on two other pages fine, but will not work on this one. Guess I need help, I have been at it for four days!
<Html>
<Head>
<Title> Information for Parents </Title>
</Head>
<Form Name="Default" Method="GET" Action="../Default.htm">
<Body bgcolor="#FFFFFF">
<Font Face="Courier New" size="3"><Strong>
<Center>
<Table Border="3" Frame="All" CellPadding="1" CellSpacing="2">
<Caption Align="Top"><B>Parents</B></Caption>
<tr>
<td>Parents
want the best education for their children. We understand that each school community has
its unique needs. Our goal is to provide your family with a positive learning environment,
the finest educational programs, and services that promote outstanding student
achievement.
Parents are children's first and life-long teachers. We value the partnership between home
and school and recognize that parental involvement is the key to success in school. You can
be involved by helping your child with homework, volunteering in our schools, or joining a
school council. By welcoming and providing opportunities for you to be involved, we can
work together to ensure that children receive the very best education.<BR></font></td></Tr>
<BR>
</Table>
<A Href="../Hatch.htm">RETURN</A>
</Form>
</Body>
</Html>
If someone can tell me why this does not display as a full page I would really appreciate it.
Thank You in advance
Len Tag: Listing duplicate machines in AD Tag: 160686
What shoudl I use, VB or batch or other
I have seen some instances of what I am trying to do, but still can't find exactly what I need, and I am new to vbs.
I would like to create user shares, and point users to these shares, say via GP or login script. I have 2 files, one for the share, and one for the actual location. When I run the batch it gives me an error, so I figured I would try vbs. The file is just a text file, and i have tried to pump it into the batch with variables, but to no avail. ANY help, push, prod in a direction, would be great. Tag: Listing duplicate machines in AD Tag: 160679
Access Denied while installing Printers in Windows Server 2003
Hi,
I have been banging my head against the wall all day trying to figure this out. We are migrating our Print Server from Windows 2000 Server to Windows Server 2003. I found some cool scripts that run on Windows XP and Windows Server 2003 that I thought would make my life easier. Silly me!
I developed my script on XP and everything seems to work. I create over 300 printers in a few minutes. I went over to my 2003 Server and it won't run.
I get an Access Denied message. The Error Code is 80041003. The Source is SWbemObjectEx.
First off, I am using the local Administrator account on the server.
Second, I thought it was some sort of policy setting that our Domain was applying. So I rebuilt the server and did not join it to a domain. It has all default security settings applied.
This code is a sample to create an IP Printer Port. I got it from microsofts site. It does not work on Server 2003.
Set objWMIService = GetObject("winmgmts:")
Set objNewPort = objWMIService.Get _
("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_169.254.110.14"
objNewPort.Protocol = 1
objNewPort.HostAddress = "169.254.110.14"
objNewPort.PortNumber = "9999"
objNewPort.SNMPEnabled = False
objNewPort.Put_
The line the program aborts on is the last line. objNewPort.Put_
According to Microsofts website this should work on Server 2003. But I can't figure it out.
I am hoping I am just missing something simple.
Any help would be greatly appreciated. Tag: Listing duplicate machines in AD Tag: 160669
read each line of variable (like readline method)?
I have a variable that has multiple lines of text - I want to go through
each one, line by line and perform an action with the information.
I know how to get line information from a text file using the readline
method, but am unsure of a way to easily do this with a variable. Any
ideas?
Thanks in advance, everyone!
Rob Tag: Listing duplicate machines in AD Tag: 160668
Have user run a script with admin credentials
Hi Guys,
I have a remote site that we need to change some Network settings for. I
do not want to have to send someone out there. I can copy the script to
the remote computer, but my script will need to run with admin
privileges. I do not wish to give the end (l)users the local admin password.
· I know I can specify a username and password for the Task Scheduler,
GUI only, the AT command does not seem to support this
· I found a news group article where Torgeir Bakken says, WMI
does not support connecting to the same computer you are running
the script from with another user credentials.
I?d simply do this remotely but I am setting a static IP on these PCs
among other network settings
Can someone throw me a link or something?
Thanks Tag: Listing duplicate machines in AD Tag: 160665
Delete Reg Key
Hey everyone,
I want to know the cleanest way to look for a regestry key and if it i
there delete it. The key in question is QuickTime Task key in th
HKLM\software\microsoft\windows\currentversion\run. I want to firs
check if the key exists and if it does remove the key. This will b
placed in a login script for all users logging into the domain.
Thanks in advance
-
Kewl
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
----------------------------------------------------------------------- Tag: Listing duplicate machines in AD Tag: 160664
Request.ServerVariables("HTTP_REFERER")
Hi All,
I'm trying to get the Referer URL by using
Request.ServerVariables("HTTP_REFERER") but all I got back is the Server or
Host Name not the whole Referer URL. Is there any way to get the entire
Refering URL that including path, querystrings....?
Thanks
Henry Tag: Listing duplicate machines in AD Tag: 160655
Computer Accounts Descripton
How can I get the Computer Account description from the AD using VBscript?
AH Tag: Listing duplicate machines in AD Tag: 160648
Message Box (default button selection)
I am using VBScript to display a message box to verification operators under certain condistions. Most of the boxes are simple vbYesNo. The question I have is that the button that is highlighted (has focus) is not the button I want to be highlighted. Being a rookie is there a way to change the button default from Yes to No?
Thanks,
Ben
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources... Tag: Listing duplicate machines in AD Tag: 160647
VB Automation Error
Hello
I am unable to access my VB COM+ component due to the following error:
CODSearchBusServices error '80070002'
Automation error The system cannot find the file specified.
I know that the DLL works and is accessible from another server.
However, on thecurrent server, it won't work. I have tried all the
forums and help sites available but no joy.
Please can you help?
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Listing duplicate machines in AD Tag: 160628
Run method, 16-bit application, sound
I have written a wrapper in VBScript that maps a drive, runs a 16-bit application from that drive using the Run method, and then unmaps the drive.
My problem is that when the script runs the application, there is no sound. The commentary is a vital part of the application, and is audible when the application is run "straight". So why can't I hear anything when I run it from VBScript?
Andrew Good
Barefoot Boy Tag: Listing duplicate machines in AD Tag: 160627
Problem when retrieving data from Web Page
Dear All,
I try to use sample code found on script center to retrieve the value
property of text object. And this works when i try to retrieve data from a
htm file on my disk. But, after i put this htm file onto my web server, i
can't retrieve any data, even on my local web site. Any ideas? Any
suggestion or feedback will be greatly appreciated. Thanks for your time.
best regards,
Eric Wu
Content of Script:
Set objExplorer = WScript.CreateObject _
("InternetExplorer.Application", "IE_")
'objExplorer.Navigate "file:///c:\scripts\password.htm" 'This works fine
objExplorer.Navigate "http://localhost/password.htm" 'This not works
objExplorer.Visible = 1
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width=400
objExplorer.Height = 250
objExplorer.Left = 0
objExplorer.Top = 0
intItems=objExplorer.Document.body.all.Length -1
Set colItems=objExplorer.Document.body.All
For i = 0 to intItems
strInfo=strInfo & "Name is: " & colItems.item(i).Name & Chr(13) &_
"Id is: " & colItems.item(i).Id & Chr(13) &_
"Value is: " & colItems.item(i).Value & vbtab & Chr(13)
Next
Wscript.Echo strInfo
Content of Passwor.htm is:
<html>
<body>
<input type=text id="OKClicked" name="OKClicked" value="12345">
<input type=text id="PasswordBox" name="PasswordBox" value="1234">
<input type=button id="butOK" name="butOK" value="OK"
onClick="document.all.OKClicked.value=this.value">
</body>
</html> Tag: Listing duplicate machines in AD Tag: 160626
Read Public Folder items from script
Hi,
I need to get metadata from mail items stored in a public folder into an
Excel spreadsheet. I'm running Exchange 2003 with Outlook 2003 on the front
end. I have managed to pull the information required from my Inbox, but
cannot find any way to access the Public Folder store.
Any help appreciated. Tag: Listing duplicate machines in AD Tag: 160624
Scope Issue - Call global function from inside class function
ex)
Public Function Join(delim)
Dim str
Dim istop
istop = stopIndex
ReDim Preserve aData(istop)
str = Join(aData,delim) ' this should be the built in VBScript join
Join = str
End Function
Basically I'm looking for the :: C++ operator equivalent. I ended up
renaming the function to get around it, but I'd like to know if it's
possible for the future.
Alec Tag: Listing duplicate machines in AD Tag: 160623
Script fails on a W2K Advanced server cluster
When I run a WMI script against my W2K Print server it works fine. I am
using WMI to return all the printers defined on the server using
Win32_printer. When I run it agains my cluster it fails. I am not getting
any kind of error the script just doesn't return any data. Any ideas? Tag: Listing duplicate machines in AD Tag: 160615
red screen of death
Does anyone know how to script this red screen of death when a user does
not have the right security patch or anti-virus software on their systems. I
want to enable this at a login script, but cannot find any information on
how to implement this.
thanks in advance. Tag: Listing duplicate machines in AD Tag: 160614
Delete unwanted subfolders
Shadrach wrote:
> *Here is what I have figured out so far..
>
> Set oFS = CreateObject("Scripting.FileSystemObject")
> Set oFolder = oFS.GetFolder("C:\Somefolder\Programs\")
> For Each oFolder In oFolder.SubFolders
> WScript.Echo oFolder.name
> If oFolder.name <> "FolderA" Then
> End If
> If oFolder.name <> "FolderB" Then
> End If
> If oFolder.name <> "FolderC" Then '
>
> Else filesys.DeleteFolder "c:\Somefolder\Programs\"
> oFolder.name
> End If
>
> Next *
Still looking for a solution to this.. c'mon coders
-
Shadrac
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
----------------------------------------------------------------------- Tag: Listing duplicate machines in AD Tag: 160613
retrieving SQL-server data
Hi,
I have several .vbs script to inspect my database with queries like
select count(*) as 'count' from tb_data where err_count > 0
select id, folder from tb_data where date > '2004-07-01'
I always use an ADODB.Connect en .Recordset to get the information. But
now I want to query
select e.id, e.folder, d.folder from tb_error e, tb_data d
where e.id = d.id
Works in ISQL, but I could not find any information in the SQL-server
books-online except for ASP programming. I don't have a webserver.
Any hints on how to use ADODB.Connect (or maybe ADODB.Command)??
Tnx
Rob Tag: Listing duplicate machines in AD Tag: 160612
computers showing up in "User List"
I cobbled together a script that writes to an Excel spreadsheet with the
users name,
logon ID, OU, and logon script, naming each page with the main OU name. I
know
that it is ugly, but it works. The main problem I am having is that it also
puts the
computer and group names on the sheets, and I only want users. Obviously I
need to
filter it better, but I am having trouble finding the proper information.
Anyone able to
help? Thanks much in advance! And, thanks to Richard Mueller for the base
script!
Randy Reimers
' CreateUserList3.vbs
' VBScript program to create a Microsoft Excel spreadsheet documenting
' all users in the domain.
'
' ----------------------------------------------------------------------
' Copyright (c) 2002 Richard L. Mueller
' Version 1.0 - November 12, 2002
' Version 1.1 - February 19, 2003 - Standardize Hungarian notation.
' This program enumerates all users in the domain and writes each user's
' LDAP DistinguishedName to a Microsoft Excel spreadsheet.
'
' You have a royalty-free right to use, modify, reproduce, and
' distribute this script file in any way you find useful, provided that
' you agree that the copyright owner above has no warranty, obligations,
' or liability for such use.
Option Explicit
Dim strExcelPath, oDomain, oContainer, strName, strScriptPath, strSam, usr,
usrDN
Dim objRecordSet, strDN, objExcel, objSheet, oObj, sClass, subPath,
NTDomain
Dim intIndex, k, sheet, strSheet, objWorkBook, i
k = 2
sheet = 1
' Spreadsheet file to be created.
strExcelPath = "F:\UserList.xls"
' Bind to Excel object.
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Add 'new
If objWorkBook.Sheets.Count < 25 then
For i = objWorkBook.Sheets.Count to 25
objWorkBook.Sheets.Add()
Next
End if
Set oDomain = GetObject("LDAP://ou=cc,dc=corp,dc=tcc,dc=inet")
EnumOU(oDomain)
' Save the spreadsheet.
objExcel.ActiveWorkbook.SaveAs strExcelPath
objExcel.ActiveWorkbook.Close
' Quit Excel.
objExcel.Application.Quit
' Clean up.
Set objRecordSet = Nothing
Set objSheet = Nothing
Set objExcel = Nothing
MsgBox "Done"
Wscript.Quit
Function EnumOU(oContainer)
For Each oObj In oContainer
For Each sClass in oObj.ObjectClass
If LCase(sClass) = "organizationalunit" Then
subPath=oObj.AdsPath
Call newSheet(subPath, sheet)
getUser(subPath)
EnumOUT(oObj)
sheet = sheet + 1
If k = 2 Then
sheet = sheet - 1
End If
k = 2
End If
Next
Next
End Function
Function EnumOUT(oContainer)
For Each oObj In oContainer
For Each sClass in oObj.ObjectClass
If LCase(sClass) = "organizationalunit" Then
subPath=oObj.AdsPath
getUser(subPath)
EnumOUT(oObj)
End If
Next
Next
End Function
' Enumerate all users. Write each user's information to the
' spreadsheet.
Function getUser(subPath)
Set NTDomain = GetObject(subPath)
NTDomain.Filter = Array("user")
For Each usr In NTDomain
strName=""
strScriptPath=""
strSam=""
usrDN = ""
On Error Resume Next
usrDN = usr.distinguishedName
intIndex = InStr(usrDN, "OU=")
usrDN = Mid(usrDN, intIndex)
' wscript.echo usr.name
strName = Mid(usr.name,4)
strName = Replace(strName, "\,", ",")
' wscript.echo usr.sAMAccountName
strsam = usr.sAMAccountName
' WScript.Echo usr.LoginScript
strscriptpath = usr.LoginScript
objSheet.Cells(k, 1).Value = strName
objSheet.Cells(k, 2).Value = strSAM
objSheet.Cells(k, 3).Value = strScriptPath
objSheet.Cells(k, 4).Value = usrDN
k = k + 1
Next
End Function
'Create, set up new page in spreadsheet
Function newSheet(subPath, sheet)
strSheet = Mid(subPath,11)
intIndex = InStr(strSheet, "OU=")
strSheet = Left(strSheet, intIndex - 2)
' Bind to worksheet.
wscript.Echo sheet & " " & strSheet
wscript.Echo sheet
Set objSheet = objExcel.ActiveWorkbook.Worksheets(sheet)
objSheet.Name = strSheet
objSheet.Cells(1, 1).Value = "User Distinguished Name"
objSheet.Cells(1, 2).Value = "Logon ID"
objSheet.Cells(1, 3).Value = "Logon Script"
objSheet.Cells(1, 4).Value = "User's OU"
' Format the spreadsheet.
objSheet.Range("A1:D1").Font.Bold = True
objSheet.Select
objSheet.Range("A2").Select
objExcel.ActiveWindow.FreezePanes = True
objExcel.Columns(1).ColumnWidth = 45
objExcel.Columns(2).ColumnWidth = 26
objExcel.Columns(3).ColumnWidth = 15
objExcel.Columns(4).ColumnWidth = 65
End Function Tag: Listing duplicate machines in AD Tag: 160610
Scripting solution needed for DHCP and trusted PDC/DHCP servers.
I have to obtain scope information from a large number of remote DHCP
servers that are also NT4 PDC servers. WMI is installed on each server but I
can't locate a method to get the scope information. I would really
appreciate someone's help to get this information.
Thanks in advance,
Scott Cooper Tag: Listing duplicate machines in AD Tag: 160607
Delete an application pool
Hi,
I want to delete the application pool I created using vbscript. How can i find it and how to delete it? Thanks.
Yang
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources... Tag: Listing duplicate machines in AD Tag: 160606
Netscape LDAP directory
I would like to search a Netscape LDAP directory for information. I have a
SMTP address I would like to see if it exists in the LDAP directory. If it
does exists, then retrieve some information(name, address, userid,etc). I
don't know how to connect to the LDAP server. I know the server name and
even the base to start the search from. Can someone provide me with the
code to connect to the server/base?
TIA
Dave Tag: Listing duplicate machines in AD Tag: 160603
Query OU membership
Hi everybody,
I'm a newbie in scripting and i would like to know if i can query the
OU of a user to map the appropriated drives in his login script.
Eric Tag: Listing duplicate machines in AD Tag: 160601
Presence of Server 2003 DC?
How might one determine if a Windows 2003 domain controller has been
installed on a Windows 2000 network?
--
jbfields@msn.com www.jbfields3.com
"Dogs may have kept us company on the hunt, but it was the cats who insisted
we invent houses and discover fire." -- Khiem Tran
(Follow-up set to: microsoft.public.scripting.wsh,
microsoft.public.windows.server.networking,
microsoft.public.windows.server.scripting,
microsoft.public.windows.server.security ) Tag: Listing duplicate machines in AD Tag: 160598
Help with Registry Modification
I am trying to use the following script to adjust the mouse sensativity - we
want to include this on the desktop of all the laptops in the org so while
attached to the dockingstation w/ a external mouse the mouse sensativity is
20 - and when on the road a simple click will turn it down to 1, making the
mouse pointer easier to control..
Using regmon the only key that needs to be changed is MouseSensitivity; and
doing it via the cpl applet changes the key and immediatly adjusts the
sensativity.
I wrote the following script and it does change the key but a reboot is
required to commit the change - can someone point me in the direction that
will make the setting take effect when set in the script?
Set WSHShell = WScript.CreateObject("WScript.Shell")
RegKey = "HKEY_CURRENT_USER\Control Panel\Mouse\MouseSensitivity"
WSHShell.RegWrite RegKey,"1","REG_SZ"
WScript.Quit
Thanks
David Tag: Listing duplicate machines in AD Tag: 160596
Monitoring Script
Hi all,
I need to create a script to monitor the performance / state of a win 2003
server. The script must create a file with information about the CPU
(temperature, ..), HD (partitions, free space, ..) Memory (free memory,
...), Users connected, Opened files, Swap file use, precesses (and resources
used by each one) .... all useful information I can get from the system.
¿Do you know how can I make that ? ¿A link to a web page about that issue?
Thanks for your help. Tag: Listing duplicate machines in AD Tag: 160592
Problem in retrieving data from SQL server 2000
I use a SQL server 2000 to store data in local language (gb and Shift-JIS). I can successfully store the data into database, but when i retrieve back from database, i only get "?" in my asp program.
Is there any solution? Thx for help. Tag: Listing duplicate machines in AD Tag: 160590
ExecWB - Stop Print Prompt
FUNCTION VBprintItemMy(toFrame)
toFrame.focus
WebBrowser="<OBJECT ID='WebBrowser1' WIDTH=0 HEIGHT=0
CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'>"
document.body.insertAdjacentHTML "beforeEnd",WebBrowser
document.body.insertAdjacentHTML "beforeEnd",WebBrowser
WebBrowser1.Silent = TRUE
WebBrowser1.ExecWB 6,2
WebBrowser1.outerHTML=""
END FUNCTION
Im Using the above function to Print a specified Div of frame....
Even i specified the parameter as 2 for WebBrowser1.ExecWB, still it
prompts
the print window to me to print...
Y is this and how can i avoid...?? Tag: Listing duplicate machines in AD Tag: 160584
string comparison to string array
How do I check if a given string is contained within either a string
array or a delimited list of strings?
eg:
strLevel = "red"
' i want to see if strLevel is one of the following, using either an array:
arrLevels = Array("red","yellow","blue")
' or a delimited list:
strLevels = "red,yellow,blue"
I just want to return a simple true/false or 1/0.
Cheers
Ben Tag: Listing duplicate machines in AD Tag: 160580
Is there a way to list computer that have a duplicate GUID in AD?