Printing messages to different printers
Hello,
How do I print text from VBS to a specific printer on our network. For
example, I hit a database and pull in the variables 'Department' and
'Content' and if say 'Department' equals 'Marketing' it'll print the
contents of 'Content' to the marketing printer.
I'll have this script scheduled to run every 5 minutes, and once the
message is printed it'll flag it as so in the database as to not print
it again.
Thanks ...
Alex Tag: Script to Update Self in Active Directory Tag: 196290
Find Replace Question
Hello all:
I would like to find all occurances of a "/" in a document and replace it
with a "," and then search for the next space (in that line) and replace it
with a ","
Example Text
100/10 hits
100/25 blocks
100,10,hits
100,25,blocks Tag: Script to Update Self in Active Directory Tag: 196288
Automatically hide/show text...
Here's what I got:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script language=vbscript>
sub toggle(id)
if document.all(id).style.display = "block" then
document.all(id).style.display = "none"
else
document.all(id).style.display = "block"
end if
end sub
</script>
</HEAD>
<BODY>
<a href="#" onclick="toggle('more')">Click me</a>
<div id=more style="display:none;">this is more text...</div>
<br>
<a href="#" onclick='toggle("more2")'>Click me again</a>
<div id="more2" style="display:None;">More more text!</div>
</BODY>
</HTML>
A pretty simple show/hide to display text and hide it with a click
again. I was wondering if someone knew how to hide the previously
selected item when an item is selected... I need it to work
automatically without having to write a huge "hideAll()" that hides all
the Divs as this page will change a lot (using for an FAQ/News page)
Thanks! Tag: Script to Update Self in Active Directory Tag: 196287
scipt to add a windows schedule?
Hi there,
I need to automate the process of adding a few tasks to the windows
scheduler (Windows 2000).
I need to run this script during the install of some software (msi).
can anyone help me get an example for this?
Thanks!
--Regards, @win Tag: Script to Update Self in Active Directory Tag: 196286
VBScript Excel formatconditions: looking for the right syntax
Hi there,
I'am working on a VBScript that fills a Excel-sheet with data from
text-files
The following code should create condition formating within a cell:
Wiith oWorkbook.cells(Regel, cColBGCount+dicbg.Count+1)
.FormulaR1C1 =3D "=3DCOUNTA(RC[-7]:RC[-1])-SUM(RC[-7]:RC[-1])"
.FormatConditions.Delete
.FormatConditions.Add xlCellValue, xlEqual, "0"
.FormatConditions.Add xlCellValue, xlLess, "-1"
.FormatConditions(1).Interior.ColorIndex =3D vbYellow
.FormatConditions.Add xlCellValue, xlLess, "-2"
.FormatConditions(2).Interior.ColorIndex =3D vbRed
End With
The syntax of the fourth line I got from Internet an it works, but the
next line:
.FormatConditions(1).Interior.ColorIndex =3D vbYellow
generates a syntax-error (translate from dutch to english):
property colorindex of class Interior can not be set (?!?!?)
(dutch: eigenschap colorindex van klasse Interior kan niet worden
ingesteld)=20
If I am not clear, just ask me..=20
TIA,=20
Andr=E9 vWG Tag: Script to Update Self in Active Directory Tag: 196283
Dumbass newbie question
Hi There,
I found some VB the other day within the Script Centre repository to bring
me the members of distribution lists. It worked well the other day. When
I'm querying another domain with different naming conventions however, I'm
having problems. The main problems (I think) are the use of spaces in my OU
name, and that each DL begins with a '#' character. I found an article
within Google groups asying I should put a '\' before my '#' to cure this,
but no luck. If someone could have a look at the below and advise me of the
actual syntax I should be using, I'd be very grateful.
***************************************************
On Error Resume Next
Set objGroup = GetObject _
("LDAP://cn=#inquiries@xxxxx.com,ou=Distribution
Lists,ou=us,dc=na,dc=ad,dc=xxxxx,dc=com")
objGroup.GetInfo
arrMemberOf = objGroup.GetEx("member")
WScript.Echo "Members:"
For Each strMember in arrMemberOf
WScript.echo strMember
Next
***************************************************
Many Thanks in advance,
Orb. Tag: Script to Update Self in Active Directory Tag: 196280
LDAP and IIS
How can I get currently login user to domain from ActiveDirectory using
vbscript on my html page via IIS WebPage? My script:
<SCRIPT language=vbscript>
Function FirstName()
On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
strUserName = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUserName)
FirstName = objUser.Get("givenName")
End Function
</script>
works but not on my WebPage. Tag: Script to Update Self in Active Directory Tag: 196279
Export Email Addresses from Active Directory Security Group
I was looking for a sample script to query an AD security group and
export each users email address to a txt file or excel file? any help
would be great. Tag: Script to Update Self in Active Directory Tag: 196276
Script works on one Win2000 server but not another
I'm trying to troubleshoot a vbs script that runs fine on some Win2000
servers but not others. If I manually run the script it runs fine, but if I
let a tool called Big Brother run it, it doesn't return any data. The Big
Brother tool should be running it using the system account. It previously
returned data until I put a MonthName() requirement in.
All servers are Win2000 SP4 and patched up to Aug patches. I've looked at
wmimgmt.msc and tried to compare settings. I think I see some security
differences there but don't know if I'm even touching this. In comparing a
system that works to one that doesn't they are both using wsh 5.6. They may
be at different mdac levels if that matters.
The script reads a registry setting, separates out the date and compares it
to todays date. It then sends updates based on the results to the Big
Brother tool.
I'm looking for some help in troubleshooting why it will run under my
account and not the system and why it runs fine on 5 out of 8 systems. Tag: Script to Update Self in Active Directory Tag: 196273
IE7 RC1 Breaks Scripts
I just installed IE 7 RC1 and my application scripts stopped working. An
example:
Dim IE, doc, pics
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "about:blank"
Do until IE.ReadyState = 4: WScript.Sleep 50: Loop
Set doc = IE.document
doc.write("test test <img src='abc.jpg'> test")
set pics = doc.all.tags("IMG")
pics.length now returns 0
Help! Help! What should I modify? I have many jobs held up because they
use this functionality to extract objects from web pages.
Thanks in advance
kk
PS: It was still running fine in the beta before RC1 Tag: Script to Update Self in Active Directory Tag: 196257
Running SQL statement from table...
All,
I have a table with the following SQL statement inside it...
SELECT * from tblPerson Where PersonID=" & request.querystring("PersonID")
How can I retreive this and execute it via vbscript to populate another
recordset...
Cheers
Td Tag: Script to Update Self in Active Directory Tag: 196251
Newbie needs Help Please
Hello,
I have decided I need to learn how to script very badly. I have been
hired as the network administrator at a quickly growing company. I
want to right a script for adding our new hires, since this is going to
be a common proccess. I need to Add a user. create an email account.
add the user to a group. create a "home directory" that thier My
Documents points to on the server, A profile, grant access to our
sharepoint portal, grant access to Customer Service email accounts.
Can I do all this with one script? I would hate to miss a step, and
have problems when a large group of new hires start. Thanks for the
help Tag: Script to Update Self in Active Directory Tag: 196249
Using VBScript as a COM object
Hi am able to use VBScript.RegExp as an object in another application,
which allows me to use regular expressions in that application. I would
like to do something similar for math functions. Is there a way to use
VBScript as a COM object so I can access its math functions? Thank you
very much.
Rick Quatro Tag: Script to Update Self in Active Directory Tag: 196243
terminal server
I all ready have this code and it works fine. When they log off the terminal
server, the script just do a loop. But i want the user to get a question
before it loops again.
They should get two options: 1. reconnect to terminal server
2. shutdown computer.
Set oShell = CreateObject(â??â??Wscript.Shellâ??â??)
Do While True
oShell.Run â??â??mstsc c:\ts.rdp,3,True
Loop
I hope someone could help me with this problem. Tag: Script to Update Self in Active Directory Tag: 196240
How can a Combobox option the one which is the default selected change based on today's date?
I have 3 combo boxes inside the html page where in I take the year
,month and day .Now I want that by default in the month combobox
current month should be default (selected).Similarly in the day
combobox Today's date should be default selected and tommorow it should
change to the tommorows date . Like wise in the year combo box.
For example today is september 13 2006.
So when he opens the page the combo boxes should display 13 September
2006 .
Now if he wants he can choose from the other dates months and years.
its done by giving SELECTED keyword in the option tag ,but in this case
selected date has to change daily.So do I need to write some script?
Thanks
Divya Tag: Script to Update Self in Active Directory Tag: 196239
Upload File to Web Folder via Web Dav
Hi experts,
I' ve got a file which i have to upload to a Web Folder via https.
In Windows Explorer it's no problem to Drag drop a file to an
network storage but is it possible to realize this within an vbscript.
Thanks for any effort. Tag: Script to Update Self in Active Directory Tag: 196238
VBScript for Outlook profile
Hi, I am just wondering if anyone knows any link that provides sample script
for adding or modifying user profile (exhcange a/c) for Outlook xp/2003? or
is it possible to do it remotely using script or policy? Thanks for advice. Tag: Script to Update Self in Active Directory Tag: 196237
View list of safe, scriptable ActiveXObjects
Hello,
I want to view the list of safe, scriptable objects that are installed
on my machine, and their methods as well. I am planning
on using them either with new ActiveXObject() with javascript
or CreateObject() in vbscript in my browser, so I need them
to be scriptable in the browser and not buzz me up with warnings
(while I am running in internet zone).
I've used OLE viewer from Visual Studio but
the list is overwhelming while things like XMLHTTPRequest
and an ATL COM object that I installed somehow are not shown,
so I supposed there is a better way.
Thanks alot, please let me know. Tag: Script to Update Self in Active Directory Tag: 196236
Help getting user account kind from IE
Hi,
Any body knows how to check user privilege with vbscript
on IE? User privilege as in whether the user is running
IE with admin or limited user priv.
I've been thinking down the line of writing to registry with WScript
and see if it fails... but I prefer the method to not invlove any
warning messages for my users (IE warns about unsafe script
for WScript...)
Thanks. Tag: Script to Update Self in Active Directory Tag: 196234
How to monitor for the absence of any new files created in a folder?
Hello all. I need a script that will repeatedly check a folder every 30
minutes, and tell me if no new files have been created during that time
interval. I've taken the script found here:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct04/hey1011.mspx
and tried to tweak it to no avail.
Any help would be greatly appreciated. Thanks!
- Dave Tag: Script to Update Self in Active Directory Tag: 196229
(free advice) avoid msgboxes in event handlers
all right, all right, you already know this(?). You may exit here.
As for myself, I have always adhered to the principal that an event
handler ought to be as minimal as possible. Preferably just set a
flag, and do your processing elsewhere. The motivation behind this
was a concern (maybe just a vague uneasiness) about all the messages
flying around the system, and the possibility of losing one as a
result of spending too much time in an event handler. And so, I
have tended to avoid msgboxes in event handlers without the benefit
of any free advice.
Anyway, the free advice comes as a result of lurking in the windows
api ng. Lately there has been an extremely long thread concerning
the above subject, with sub-debates concerning what actually happens
when you do use a msgbox in an event handler.
While the api guys delight in the details, you scripters just want
to get the job done, and so the above advice. Just set aside all
the technicalities, and avoid msgboxes in event handlers altogether.
cheers, jw Tag: Script to Update Self in Active Directory Tag: 196225
Using Text Area object at run time..
I am using a simple HTA application. I have made a drop down box which
has a few values. Depending upon values selected in the drop down box
appropriate message has to be displayed in textarea.
Can anyone help me? I have defined the textarea in the body section. I
am not sure where I have to put the code.
Let me know if possible with code example.
Thanks
Dave Tag: Script to Update Self in Active Directory Tag: 196223
Verifying a user without knowing his precise OU
Hello,
Here's the task at hand. I have a user drive which has twice as many folders
as we have employees. Therefore, someone hasn't done its job of deleting the
users. Now, I'm not talking about having 20 employees and 40 folders; it's
in the thousands.
I did a dir /b and outputted the result in a text file, which is easily
parsable in vbscript. Folders are name through the pre-Win2000 username,
which is cool.
However, the thing is, the users can be located in various OUs, for policy
and site reasons. Therefore, I don't want to go through EACH OU; I'd like to
be able to input to the script the name of the user and search AD
automatically through a function of some sort.
Is it even doable ?
Thank you !
Mathieu Tag: Script to Update Self in Active Directory Tag: 196215
Forcing a download in asp results in zero bytes file
Hi to all,
I'm a JScript user, but this time I've a problem with someone else
code, written in VBScript. The problem is: using the script I join to
force the download of a .pdf file, works fine except with a certain pdf
file of 7 mb: with this very pdf, it results in a zero byte download.
The file is not corrupted and opens finely in Acrobat if I download it
the usual way. The problems arise only when downloaded via this -
usually well working - script. The application is not mine and I cannot
rewrite it in Jscript :-D. Any idea or suggestion? Thank you alot!!
J.
PS the fact that the file is bigger than usual can count?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%Response.Buffer = True%>
<%
On Error Resume Next
Dim strPath
strPath = CStr(Request.QueryString("file"))
'-- do some basic error checking for the QueryString
If strPath = "" Then
Response.Clear
Response.Write("Specificare il file.")
Response.End
ElseIf InStr(strPath, "..") > 0 Then
Response.Clear
Response.Write("Cartella non trovata.")
Response.End
ElseIf Len(strPath) > 1024 Then
Response.Clear
Response.Write("Path troppo lungo.")
Response.End
Else
Call DownloadFile(strPath)
End If
Private Sub DownloadFile(file)
'--declare variables
Dim strAbsFile
Dim strFileExtension
Dim objFSO
Dim objFile
Dim objStream
'-- set absolute file location
strAbsFile = Server.MapPath(file)
'-- create FSO object to check if file exists and get properties
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'-- check to see if the file exists
If objFSO.FileExists(strAbsFile) Then
Set objFile = objFSO.GetFile(strAbsFile)
'-- first clear the response, and then set the appropriate
headers
Response.Clear
'-- the filename you give it will be the one that is shown
' to the users by default when they save
Response.AddHeader "Content-Disposition", "attachment; filename="
& objFile.Name
Response.AddHeader "Content-Length", objFile.Size
Response.ContentType = "application/octet-stream"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
'-- set as binary
objStream.Type = 1
Response.CharSet = "UTF-8"
'-- load into the stream the file
objStream.LoadFromFile(strAbsFile)
'-- send the stream in the response
Response.BinaryWrite(objStream.Read)
objStream.Close
Set objStream = Nothing
Set objFile = Nothing
Else 'objFSO.FileExists(strAbsFile)
Response.Clear
Response.Write("File non esistente.")
End If
Set objFSO = Nothing
End Sub
%> Tag: Script to Update Self in Active Directory Tag: 196214
create registry key
Shouldn't this script create a registry key called test under the path of
HKEY_CURRENT_USER\software\microsoft\Exchange\
const HKEY_CURRENT_USER = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\MICROSOFT\EXCHANGE\test"
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath Tag: Script to Update Self in Active Directory Tag: 196211
remove windows games
My bosses have decided that they want all of the windows games removed. I'm
looking for a script that I can run to automate that process rather than
having to go to each machine in person.
Any help would be appreciated.
Bill Tag: Script to Update Self in Active Directory Tag: 196208
Update Information in SQL from a VBS script
I have a vbs script that calls a list of systems inside a SQL database.
It then uses that list to go out and collect additional information on
those systems and inserts the collected data into another table.
My question is what is the best way to remove redundant date. Should I
just update the information in the existing cells (if so how?) or
should I create a clean up script that looks for duplicate items and
delete the ones with the oldest time stamp?
Thanks
-Matt- Tag: Script to Update Self in Active Directory Tag: 196205
Problems with objRecordSet (vbs)
Hello,
i am new to vbs and here is my first prob.
I want to display all ous from a starting ou and all sub-ous.
And for every (sub)ou i want to display the users.
So, heres is my script for a better understanding:
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
Set objCommandUsers = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
Set objCommandUser.ActiveConnection = objConnection
Set ExApp = WScript.CreateObject("Excel.Application")
ExApp.Visible = True
ExApp.Workbooks.Add
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommandUsers.Properties("Page Size") = 1000
objCommandUsers.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT ADsPath FROM 'LDAP://OU=OU,dc=domain,dc=com' WHERE " & _
"objectCategory='organizationalUnit'"
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
objRecordSetUsers.MoveFirst
anzahlous=0
anzahluser=0
Do Until objRecordSet.EOF
anzahlous=anzahlous+1
ExApp.Cells((anzahlous),1) = objRecordSet.Fields("ADsPath").Value
objCommandUsers.CommandText = _
"SELECT Name FROM '" &
objRecordSet.Fields("ADsPath").Value & "' WHERE objectCategory='user'"
ExApp.Cells(anzahlous,2)= objCommandUsers.CommandText
Set objRecordSetUsers = objCommandUsers.Execute
WScript.Echo ("Anzahl")
Do Until objRecordSetUsers.EOF
anzahluser=anzahluser+1
ExApp.Cells((anzahluser),2) =
objRecordSetUsers.Fields("ADsPath").Value
'' objRecordSetUsers.MoveNext
loop
objRecordSet.MoveNext
Loop
Set objConnection = nothing
Set objCommand = nothing
Set objRecordSet = nothing
Set objRecordSetUsers = nothing
Set objCommandUsers = nothing
So with the objCommand and the objRecordSet i get the list of all ous
and sub-ous that works fine.
In the Do Until objRecordSet.EOF i list all the ous in an excel-sheet
and now in this do until-loop i want to get all the users in this ou.
So, i have created the objCommandUsers and the objRecordSetUsers i
want to get the list of the users. But this does not work?
Why?
Doesn anyone have any idea?
Thanks Dirk Tag: Script to Update Self in Active Directory Tag: 196200
How to remove all elements in a combobox using VBscript
Hi everybody,
I have a HTML Form, which contains a COMBOBOX ( <SELECT ID="...
...>...</SELECT> ).
I populate this COMBOBOX in VBscript by using the method .ADD like this
:
Set objOpt = document.CreateElement("OPTION")
objOpt.Value = "value"
objOpt.Text = "text"
myForm.MyCombo.add objOpt
this works fine, but I'd like to remove all elements of this COMBOBOX,
somebody could tell me how to do this ?
I've tried myForm.MyCombo.Items.Clear (I found it in the Web) but no
success.
Thanks for your help,
Vincent Tag: Script to Update Self in Active Directory Tag: 196186
Check Services with no WMI
Is there a way to check the Startup mode and status of a service without
WMI?
Thanks!!!
Carlos Felipe França da Fonseca Tag: Script to Update Self in Active Directory Tag: 196176
RUNAS inside of .vbs
I need to run this under a user account that has administrative rights
Can I put in a username and password in clear text inside the .vbs script?
set WshShell = CreateObject("WScript.Shell")
On Error Resume Next
WshShell.RegDelete "HKEY_LOCAL_MACHINE\SOFTWARE\FLEXlm License
Manager\ADSKFLEX_LICENSE_FILE"
set oEnv=WshShell.Environment("System")
oEnv("ADSKFLEX_LICENSE_FILE") = "@server"
wscript.echo "DONE Importing VARIABLES"
--
Dave Tag: Script to Update Self in Active Directory Tag: 196168
ObjUser.putex gives me "unspecified error"
When I run the following command in my script, I get "Unspecified Error"
Const ADS_PROPERTY_APPEND=3
Set objUser = GetObject("LDAP://" & userDN)
'User DN is correct as I can verify it using the message box below.
MsgBox "Writing to " & objUser.DistinguishedName
objUser.putex ADS_PROPERTY_APPEND,"proxyAddresses","/o=Org"
objUser.SetInfo
Thank you! Tag: Script to Update Self in Active Directory Tag: 196167
Network Adapter Protocols and Binding Order
I am trying to script the following:
1. Determine the Network Connection Binding order on a machine that has
multiple Network Adapters.
2. Enumerate the list of Protocols associated with a particular network
Adapter. I already have a script that would enumerate all Protocols
installed on a machine.
I would prefer to go the WMI way, if possible. However, I can live with
reading registry values for now.
Any help is appreciated.
Thanks in advance,
ganesh Tag: Script to Update Self in Active Directory Tag: 196166
How do I grab IP address from a connection?
I'm not sure where to start - say I have a connectoid "VPNFOOBAR". I
connect to it and then I need to add a route, like "route add 10.0.4.0
mask 255.255.255.0 <assigned address from VPNFOOBAR>". I can script the
connection, but I can't figure out how to grab the assigned IP address.
Can anyone help?
Thanks in advance! Tag: Script to Update Self in Active Directory Tag: 196162
RMTShare/Permissions
I'm needing to get a list of shares from specified servers and the
permissions on said shares. Not being too good at VBScript, I ran across
RMTShare. My problem is, by simply running "rmtshare \\server" I get a list
of shares on the server, but not their permissions. For this I'd need to
run "rmtshare \\server\share". The problem is that I need to automate the
process. Does anyone know how I could do this with or without rmtshare? Is
there some way to store the share list in a file (i.e. "rmtshare \\server >
file.txt") and then have a VBScript access the file's data as an array to
fill in "rmtshare \\server\share"? TIA. Tag: Script to Update Self in Active Directory Tag: 196158
Is the syntax correct?
Hi,
Need help to check is the syntax correct:
WshShell.RegWrite
"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop"
"NoDeletingComponents"=dword:00000001
"NoEditingComponents"=dword:00000001
"NoCloseDragDropBands"=dword:00000001
"NoMovingBands"=dword:00000001
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.Run "RUNDLL32.EXE Shell32.dll,SHExitWindowsEx 0"
WScript.quit
Is it OK? Tag: Script to Update Self in Active Directory Tag: 196155
EXE from ASP w/db connection
I have an exe (VB) that performs updating and table inserts.
Currently, a user would simply double click the exe to execute.
Now I want to call this from ASP. When I do so, my log file (which is
created w/in the exe) says that 'Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection.'
Now my db connection string in the exe is set to use Integrated Security.
Within IIS, I'm using anonymous access with 'WebUser' as my username. I
granted this user full control under security for the exe. Again, if I
simply double click the exe and run it, all is well. But calling it from the
asp page gives me the login failed response. Tag: Script to Update Self in Active Directory Tag: 196154
How to enable NTFS inheritance flag?
I need a script that given a folder path,set its NTFS inheritance flag.I need
it to be able to also interprete UNC paths and work in the current user
security context,without requiring WMI permissions on the hosting system(the
problem I actually have when using xcacls.vbs;because the running user needs
to have full permission on both issuing and hosting nodes' WMI
namespace;which I don't want to mess with;specially when the hosting
fileserver is also my domain controller). Tag: Script to Update Self in Active Directory Tag: 196149
Runas
I am new to scripting. I am trying to find out how I can preset the username
and password of an admin account so that 2 pieces of software can be
installed on our users devices with the Administrators needing to walk to
every desk. Tag: Script to Update Self in Active Directory Tag: 196145
Run script on remote computer
We have 10 Windows 2003 domains (1 root, 8 children, 1 grandchild) and 28
Windows 2003 Domain Controllers.
company.com (2 DCs)
childA.company.com (2 DCs)
grandchildA.childA.company.com (4 DCs)
childB.company.com (4 DCs)
childC.company.com (4 DCs)
childD.company.com (3 DCs)
childE.company.com (3 DCs)
childF.company.com (2 DCs)
childG.company.com (2 DCs)
childH.company.com (2 DCs)
At the end of this message is a script called MasterScript. MasterScript
causes each and every Domain Controller in the forest to locally run its own
local copy of a second script called SlaveScript. I run MasterScript from my
workstation, which is a member of ChildA.company.com, and I run it using
Enterprise Admin credentials from the root domain (company.com). Everything
works just fine except that in exactly 2 of the child domains (child C and
child F) none of the 6 Domain Controllers will locally run their local copy
of SlaveScript. When I locally log into each of the 6 problem Domain
Controllers using the same Enterprise Admin credentials, I can manually run
the local copy of SlaveScript and it works fine.
So it seems that the childC and childF domains (or at least their DCs) are
set to not allow remote script execution. What am I missing?
----------- MasterScript -------------------------
str_exeToRunRemotely = "WScript.exe " & Chr(34) & "C:\Program
Files\EventLogArchive\SlaveScript" & Chr(34)
For int_counterI = 1 To 28
' Connect to WMI
set obj_WMIService = GetObject("winmgmts://" & ary_str_DCs(int_counterI) &
"/root/cimv2")
' Obtain the Win32_Process class of object.
Set obj_process = obj_WMIService.Get("Win32_Process")
Set obj_program = obj_process.Methods_("Create").InParameters.SpawnInstance_
obj_program.CommandLine = str_exeToRunRemotely
' Execute the program now at the command line.
Set obj_shell = obj_WMIService.ExecMethod("Win32_Process", "Create",
obj_program)
Next
----------- MasterScript ------------------------- Tag: Script to Update Self in Active Directory Tag: 196143
find dile owned by user
Hello
I have a problem....on a file server I have to find all the file owned
by user and put the list in a file, for example in a excel spreadsheet.
I can use only a vbscript, I can't install software to do this task.
But I'm a beginner on VBscript, so please can some one help me ?
Thanks
Luca Tag: Script to Update Self in Active Directory Tag: 196133
Datediff
Hello,
I have a problem implementing datediff function in script with the
input from txt file, where the data is in the followingformat:
10:00
08:01
I need to subtruct the timelast-timeprev, where the timelast is the
first line in the file and
timeprev is the second line in the file. Here is the script:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("c:\timerun.txt", 1)
timeLast = objFile.Read(6)
'wscript.echo timeLast
timePrev = objFile.Read(10)
' wscript.echo timePrev
timeDiff= Round((DateDiff("n", timeprev, timelast)/60),2)
'timeDiff= (DateDiff("n", timeprev, timelast)/60)
timeDiff2= DateDiff("n", timeprev, timelast)
'wscript.echo timeDiff
If timeDiff2 < 60 then
mytime =timediff2
InfoMB=MsgBox ("result:"&Space(1) &mytime &Space(1)
&"minutid",vbInformation + vbOKCancel, "test")
wscript.echo "result:" &Space(1) &mytime &Space(1) &"min"
Do you have any suggestions?
Thanks.
Vitali. Tag: Script to Update Self in Active Directory Tag: 196130
Recycling web application
Hi There,
Is it possible to restart and application or recycle the application pool
from within classic asp.
I find the size of the application is becoming too big and cuases a large
number of errors before it recycles itself. I do not want to set timed
recycles but want to be able to do this from within code. Tag: Script to Update Self in Active Directory Tag: 196127
executing code on remote PC
Hi,
How can I execute the below code on a remote PC ?
Set objWord = CreateObject("Word.Application")
Set colTasks = objWord.Tasks
For Each objTask in colTasks
If objTask.Visible Then
Wscript.Echo objTask.Name
End If
Next
objWord.Quit Tag: Script to Update Self in Active Directory Tag: 196125
Rename Printers in Server 2000
hello,
I have to rename printers .
Its working fine on XP but on Windows 2000 Server i am having the error:
C:\script\printerrename1.vbs(14, 5) Microsoft VBScript runtime error: Object
doesn't support this property or method: 'objPrinter.RenamePrinter'.
I have learnt that RenamePrinter is not compatible with Windows 2000 Server.
Can you please suggest me some other ways of doing it:
Here is the my script that i run
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery _
("Select * From Win32_Printer")
For Each objPrinter in colPrinters
If Left(objPrinter.DeviceID,22) = "Client\pailles_dom-nns" Then
Wscript.Echo objPrinter.DeviceID
Wscript.Echo Mid(objPrinter.DeviceID, InStrRev(objPrinter.DeviceID, "\") + 1)
varprint= Mid(objPrinter.DeviceID, InStrRev(objPrinter.DeviceID, "\") + 1)
objPrinter.RenamePrinter("hp LaserJet 1320 PCL 5e")
END IF
Next
Thanks
Nazeedah Tag: Script to Update Self in Active Directory Tag: 196122
Creating filters over results of an ASP page
Hello everyone. i've been learning a lot here in the past few weeks,
but unfortunately it's not enough for what i need now...
Here it goes:
I have an ASP script wich scans a given directory and returns
information on the files inside it (name, type, size, date last mod,
owner and author). Everything works fine, but now i need a new element
on this - a way to filter the results.
someone i know has told me something about recordsets, but all the info
i can find is about connections with Access databases.
so, i'd like to ask if there is a way to sort my problem out, and if
you know any links or online documentation to do so.
best regards and thanks in advance,
ember Tag: Script to Update Self in Active Directory Tag: 196111
Adding a File menu in HTA
I am a beginner with HTA and would like to display a simple
html page and give the user 3 choices.
Save..
Print Preview...
Print...
I know how to create the simple page....
can someone explain how I add a regular 'File' menu with the above options.
Thanks,
Charles W Tag: Script to Update Self in Active Directory Tag: 196101
Using User32.dll function from VBScript(WSH)!?
Is there a way, to use a user32.dll function over Scripting Host in
Visual basic Script?
Greeting
A.Gallus Tag: Script to Update Self in Active Directory Tag: 196099
Switch proxy (On/Off)
I search for vbscript (or small utility) to switch IE proxy (On/Off) for the current connection (modem).
Saku. Tag: Script to Update Self in Active Directory Tag: 196098
Has anyone found a way for users to edit their personal information, like
address & phone numbers in AD without being admins and without modifying the
SELF permissions.