Home All Groups Group Topic Archive Search About



Scripting for Windows Server

microsoft.public.windows.server.scripting
Score [MSH] Pause a Script?
Dominik - 14 Jan 2006 11:42 PM - 5 messages
Hi! (1) how do i get the exit code of an app started with "invoke-command"?     does "$exitcode = Invoke-Command $cmd" work? (2) is it possible to halt the script within my loop until the app has ...
Score [MSH] Cmdlet casing consistency
Keith Hill [MVP] - 14 Jan 2006 8:57 PM - 4 messages
I've been looking at the new docs for beta 3 (getting started guide). Towards the back (page 71) is a list of cmdlet names.  The casing consistency is improving but there is still more work to be done.  :-)  For ...
Score New To Scripting
Dog - 14 Jan 2006 6:28 PM - 6 messages
I am new to Scripting and have no idea where to start? any help? ...
Score Need CSVDE to dump user group memberships
Spin - 14 Jan 2006 5:09 PM - 5 messages
Gurus, How can I make a csvde -f > filename.txt dump the group membership of each user along with the other default data? ...
Score To Richard Mueller re: your LastLogon VBS script
Spin - 14 Jan 2006 3:03 PM - 6 messages
I love your LastLogon VBS script as shown in the link below.  Absolutely sweet work.  Kudos to you. My only question is, can you make it so that the output of the time/date of last logon comes BEFORE the DN of the user? ...
Score Mass-change file prefix in a given set of folders
Spin - 14 Jan 2006 12:36 PM - 5 messages
Gurus, I work at a small non-profit and we have a folder structure that my colleagues and I share and all the files inside this one folder structure have file names pre-fixed with the name of a certain project.  I need to ...
Score Script to change registry entry
Jrex7 - 13 Jan 2006 9:05 PM - 4 messages
I need to come up with a script to change the default license server in several Win2K servers. The value to be change is under the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService\Parameters Name: DefaultLicenseServer Data type: REG_SZ Data value: ServerName ...
Score Create an OU in an Existing OU
Erik Gjertsen - 13 Jan 2006 9:01 PM - 3 messages
I fails in line 1. Whay ? Set objOU1 = GetObject("LDAP://ou=ou1,dc=master,dc=gjertsen,dc=as") Set objOU2 = objOU1.Create("organizationalUnit", "ou=OU2") objOU2.SetInfo Erik Gjertsen ...
Score ntfs file permissions, ownership
Dan Lewis - 13 Jan 2006 7:01 PM - 13 messages
I have several directories/subdirectories with many files in each on a server that currently have ntfs permissions granted only to the owner (local/domain adminstrators have no permissions).  I want to add the local administrators group to those, granting full permissions the that ...
Score Standardize drive assignments
Craig - 13 Jan 2006 5:34 PM - 8 messages
I would like to force all users to a standard drive mapping scheme, currently there are many varaitions and I would like to force these to disconnect and assign 6 drive mappings.  I am very new this and would like ...
Score [MSH] Any documentation on format.mshxml?
Neville Bagnall - 13 Jan 2006 1:29 PM - 10 messages
Is there a reference for the *.format.mshxml files? A Schema? An explanation of the CustomControl Element? I presume System.Management.Automation.Commands.Internal.Format.* will  never be documented? Its a pity. Third parties could write format-*  cmdlets that could feed into out-host. ...
Score Remote script
SuderMan - 13 Jan 2006 1:26 PM - 9 messages
Hello ! I'm running a script that launch other script on the remote machine. There is no error but also there is no effect on the remote machine. I have enabled value called "Remote" at "SOFTWARE\Microsoft\Windows Script Host\Settings" ...
Score how can i know the default mailbox size by script???
Thomas - 13 Jan 2006 8:28 AM - 2 messages
i want to know the default mailbox size, if over 1GB, it will show a message tell the user delete some email. ...
Score [MSH] Get-Command and Whence
Keith Hill [MVP] - 13 Jan 2006 6:24 AM - 2 messages
The get-command cmdlet is oh so close to providing whence functionality.  It only needs to display info on "reserved word" like: for, foreach, do, while, until, break, return, if, elseif, else, etc.  Would that be too weird to add ...
Score FW: invoking monad cmdlet
ªN¯Õ - 13 Jan 2006 5:39 AM - 8 messages
I am forwarding this question for someone who posted it on microsoft.public.dotnet.scripting. I have to invoke monad cmdlets from my c# program (windows service / application) How do  I go about doing it ? It will be helpful if some one can point me to the namespaces to look at or ...
Score [msh] get-credential
/\/\o\/\/ [MVP] - 13 Jan 2006 12:40 AM - 3 messages
get-credential gives an imputbox in beta 3 it's mentioned in the help so I guess this is by design. is it not possible anymore to get the ****** gr /\/\o\/\/ ...
Score Robocopy access denied
Nocturnal - 13 Jan 2006 12:28 AM - 4 messages
I'm attempting to copy over a folder from one workgroup computer to another on the same workgroup.  I used the syntax: robocopy \\share\H\Folder "C:\Documents and Settings\Owner\Folder" /e /copyall It then goes ahead and starts saying access denied and retrying with error ...
Score [MSH] Keyboard-Shortcuts?
Dominik - 12 Jan 2006 9:38 PM - 11 messages
hi! i'm new to monad so maybe someone already asked this: if i do "get-help some-cmdlet" i usally get several pages of text. then i want to hit the pageUp-key to move to the beginning of that text but instead of scrolling the console ...
Score [MSH] Convert-Path and pipeline input issue
Keith Hill [MVP] - 12 Jan 2006 9:25 PM - 3 messages
This is in beta 3.  Convert-Path doesn't seem to accept pipeline input: MSH:91 # ".\foo.msh" | test-path True MSH:92 # ".\foo.msh" | convert-path convert-path : Input object cannot be bound to any parameters for the ...
Score Parameters in MSH
Tom G. - 12 Jan 2006 8:54 PM - 4 messages
Is there any equivalent in MSH of the batch file parameter %0, which is the name of the currently executing batch file? It was a handy means by which a script could refer to itself without actually hardcoding the name of the script in the script itself. ...
Score Monikier string problem
Nick B - 12 Jan 2006 8:13 PM - 2 messages
Can anyone see what i am doing wrong here: Set colEvents = objWMIService.ExecQuery _     ("Select * from Win32_NTLogEvent Where TimeWritten >= '" _         & dtmStartDate & "' and TimeWritten < '" & dtmEndDate & "'And not ...
Score (msh) add-member
/\/\o\/\/ [MVP] - 12 Jan 2006 8:12 PM - 6 messages
How to add a Propertyset with add-member e.g. add the DriveInfo PropertySet $OS = get-wmiobject win32_operatingsystem add-member -in $OS -type PropertySet DriveInfo -value SystemDirectory,WindowsDirectory so I can do this : MSH>$os | ft DriveInfo same as the free propertieset ? ...
Score Running script on remote machine
SuderMan - 12 Jan 2006 7:47 PM - 18 messages
Hello ! I have a script that I would like to run on several remote machines. I've tried several solutions but none of them is really working. Tools like psexec are not always working correctly. The best solution would the VBScript so in fact I need a script to run other ...
Score Delay
peter - 12 Jan 2006 6:02 PM - 2 messages
Hi I need to be able to have a delay in my vb script so the next line doesnt do anything until set amount of time.  Tried the sleep/ping command, but still no joy. I need the delay to run in the script and not having other files. ...
Score ADSI to set never expires
David J. Cartwright - 12 Jan 2006 4:12 PM - 2 messages
How do i use ADSI to set password never expires and cannot change pw ? Set oUser = oComputer.Create("user", "************") sPassword = RandomPassword oUser.SetPassword sPassword '<--set never expire and cannot change pw here.....is ther a property ? oUser.FullName = "***************" oUser.Description = "*************" ...
Score WSUS - behavior of Automatic Updates
Andrea Racca - 12 Jan 2006 10:39 AM - 2 messages
Hi, I like to force client of WSUS to install Updates. In Group Policy Object Editor, I expand Computer Configuration, expand Administrative Templates, expand Windows Components, and then click Windows Update. In the details pane, I double-click Configure Automatic Updates. ...
Score Where 2 find basics about Win Ser scripting
Ashish - 12 Jan 2006 6:41 AM - 3 messages
Dear All, Please advise me how n from where 2 start windows scripting? ...
Score (msh) [net.IPAddress]::tryparse()
/\/\o\/\/ [MVP] - 12 Jan 2006 12:49 AM - 4 messages
looks if it is already parsed tostring MSH>$ip = new-object net.IPAddress(0) MSH>[net.IPAddress]::tryparse("10.0.0.1",$ip) Cannot convert argument "1", with value: "0.0.0.0", for "TryParse" to type "System.Net.IPAddress&": "Cannot convert "0.0.0.0" to "System.Ne ...
Score [MSH] $args bug
Keith Hill [MVP] - 12 Jan 2006 12:21 AM - 10 messages
This doesn't seem right to me: MSH:48 # function huh { write-host "args[0] is $args[0]" } MSH:49 # huh 8.0 args[0] is 8[0] and has in fact broken my "CD" replacement function. ...
Score [MSH] Ctrl+C does not yield a new line
Artus Krohn-Grimberghe - 11 Jan 2006 10:16 PM - 7 messages
A bug or a new feature? When I press Ctrl+C Monad does not give me a newline. Instead it just appends the prompt to the current line. Already filed by someone? ...
Score "Show Icon in Notification..." for NIC
Eric v.s. - 11 Jan 2006 10:12 PM - 6 messages
Hello, I have a script that (during a new server build) will set various Network Adapter values that are common to all of our servers... the one item that I am missing is figuring out how to check the box for "Show Icon in ...
Score Monad beta3 "features?"
RichS - 11 Jan 2006 10:01 PM - 5 messages
Just installed the Monad 3 beta 1)  get-alias just appears to return the commandtype and name properties.  The definition property does not seem to be returned 2) select-object only appears to work on the first property in the list.  It ...
Score monkier question
Nick B - 11 Jan 2006 8:48 PM - 2 messages
how would you change the following monkier to return all events that are not informational or aduit sucess Set colEvents = objWMIService.ExecQuery _     ("Select * from Win32_NTLogEvent Where TimeWritten >= '" _         & dtmStartDate & "' and TimeWritten < '" & dtmEndDate & "'") ...
Score Complex Password Scripting
Greg - 11 Jan 2006 8:21 PM - 8 messages
I have an OU that will have about two hundred users in it.  The operations manager wants to change all of the passwords to ie. "ABCDEF%1%2"  ABCDEF would be a fixed variable and %1 would be the first initial of the users ...
Score event log and ms access error
Nick B - 11 Jan 2006 7:10 PM - 4 messages
I am trying to copy event logs stats to a db in access from a hard coded array.  It works if there i use only one machine but if i use the array i get the following error H:\Scripts\event logs to db.vbs(30, 5) ADODB.Recordset: Operation is not ...
Score [MSH] Microsoft.Management.Automation.Core\FileSystem::\\<server>\<share>
Keith Hill [MVP] - 11 Jan 2006 5:47 PM - 6 messages
This is new.  I got this by using tab-completion after typing in the \\<server>\<share> portion of the UNC path.  Hmm, I'm not sure that I like this as it makes my UNC paths even longer. ...
Score Manage printers on remote computer
SuderMan - 11 Jan 2006 4:06 PM - 3 messages
Hello ! Do You know a way to list, add or delete network printer on remote computer using vbs script or some other tool ? I'm using W2k. Thanks. ...
Score [MSH][IronPython]Use of IronPython in Monad, Part 2
newpops - 11 Jan 2006 4:01 PM - 2 messages
We can call IronPython in Monad. See. [link] ...
Score [MSH][IronPython]Use of IronPython in Monad
吉岡 - 11 Jan 2006 3:41 PM - 2 messages
This item is how to Use theIronPython in Monad. [STEP1] Install of IronPython 1.0 Beta1 Last month IronPython 1.0 Beta was released. [link] The install of IronPython is very easy. ...
Score 'canned' script from scriptcenter works on W2k3 but not W2k
Eric v.s. - 11 Jan 2006 2:25 PM - 2 messages
Good morning, I found a pre-built script that is just what I need...except it doesn't work on W2K even though the scriptcenter info says it should. The script is at the end of this email and is used to modify  Dynamic DNS ...
Score Copying a _templateUser.
Alphanaut - 11 Jan 2006 2:10 PM - 7 messages
Hello everyone. I was thinking of creating users and homefolders via vbs. The users are listed in an .xls file. I know, when scripting, the add user part does not create its homefolder like it does when copying the _templateUser in Active Directory Users and ...
Score Prohibiting Script from running on Terminal Server
Martin G - 11 Jan 2006 11:36 AM - 2 messages
I need a vb statement that exclude the login script from running on a terminal server. I can do it in a batch file, like this: @ECHO OFF IF "%COMPUTERNAME%" == "COMPUTERNAME" GOTO MAP IF "%CLIENTNAME%" == "" GOTO MAP IF "%CLIENTNAME%" == "Console" GOTO MAP ...
Score Startup Script from AD policy
david carvalho - 11 Jan 2006 9:52 AM - 7 messages
Hi! I'm writing a simple script under some "OU" policy, computer configuration\windows settings\scripts it runs ok when it's just to write something on screen for example. The problem is tha I want to run an executable (when the machine starts up, not ...
Score Script to install a printer with settings
SP - 11 Jan 2006 7:19 AM - 3 messages
There are sample to create a script to install a particular printer with settings? ...
Score [MSH] There's K, M and G. Where's T?
Keith Hill [MVP] - 11 Jan 2006 6:13 AM - 7 messages
Considering that it is not unheard of to have terabytes of storage it might be nice to get "T" defined in MSH to represent terabytes.  BTW I love the other three.  Submitted: 775939284. ...
Score [MSH] Exes start with numbers
Keith Hill [MVP] - 11 Jan 2006 1:34 AM - 13 messages
Beta 3 still chokes on executing one of my utility exes that starts with a number: 64decode.exe.  Couldn't the MSH parser detect that "64d" isn't a valid number and kick back into command mode and see if there is an ...
Score Mshsnapin (part 1): usage of mshsnapin commands.
George Xie [MSFT] - 11 Jan 2006 12:46 AM - 12 messages
Latest beta3 release of monad added the capability of adding/removing cmdlets and providers in current running session through mshsnapins. Mshsnapin is a logic group of cmdlets and providers can be manipulate as a unit in monad engine. Following commands can be used for manipulating mshsnapins, ...
Score [MSH] Question about release dates
Chris Warwick - 11 Jan 2006 12:06 AM - 5 messages
This has been a LONG Beta! This is good.  I've seen a whole bunch of stuff discussed and suggestions from the group incorporated into the product (I still recall the file redirection syntax discussions:-).  This is good too. ...
Score [MSH] get-member output of "special name" type members
Keith Hill [MVP] - 10 Jan 2006 11:54 PM - 6 messages
For the next drop could you seriously consider fixing get-member output to eliminate the output of compiler generated methods.  For example this:    TypeName: System.Management.Automation.Commands.MatchInfo Name           MemberType Definition ...
Score [MSH] Help about_operators
Keith Hill [MVP] - 10 Jan 2006 11:26 PM - 2 messages
In general the help seems to be getting better except for the *lame* paging output that leaves a "<SPACE> next page; <CR> next line; Q quit" turd on the last page.  Anyway, I would really like to see the help topic provide a basic table listing out the operators.  This topic tells me just about everything except for what I want - a quick reference to what the actual operators are.  Would it be too hard to do something like this: ...
Score getting rid of a readonly and constant variable in MSH
Artus Krohn-Grimberghe - 10 Jan 2006 11:01 PM - 7 messages
Did not find any option to do so as even the intuitive set-variable <name> -option "none" or set-variable <name> -option "non" -force seem to have any effect. Regards, Artus PS: Still Beta 2. I'll update tomorrow. ...
Score Access denied copying file to all users/startup
xr7 - 10 Jan 2006 10:48 PM - 3 messages
I am working on a script to copy a shortcut into the all users\startup folder.  It keeps failing with access denied.  I am logged on as the administrator when running the script.  I can manually copy the file ...
Score new beta 3 drop of Monad is up on Download Center
Adam Barr [MSFT] - 10 Jan 2006 9:38 PM - 8 messages
The long-awaited beta 3 drop of Monad, including the change to allow loading of snapins, is now up on Download Center: x86: [link] ...
Score Setting TerminalServicesInitialProgram and TerminalServicesWorkDirectory through VBScript
ryserbryan - 10 Jan 2006 9:01 PM - 2 messages
I am trying to set these in an asp page to create a new userid.  But after running the below code I get the error "Microsoft VBScript runtime error '800a01b6' Object doesn't support this property or method: 'TerminalServicesInitialProgram'".  If I comment out the two ...
Score How to impersonate as a different user? (MSH)
Artus Krohn-Grimberghe - 10 Jan 2006 7:32 PM - 20 messages
Suppose I have a thread (msh.exe) running as my non-admin user. Now I want to change some settings for which I need to impersonate as a different user (i.e. BUILTIN\Administrator). I know I could do this by ...
Score Why can't I open two files in my script
Kevini - 10 Jan 2006 3:58 PM - 6 messages
I thought it would be simple as I have a txt file to read the computers and I want to go to each computer and open a txt file and pull out one line and then send the results. I must have something wrong. It gets stuck athe the ...
Score Restricted Distribution Lists...
SysAdmin Guy - 10 Jan 2006 3:46 PM - 2 messages
Hey, does anyone know how to show all the DLs in AD that have message restrictions?  (Like 'Accept Messages' and 'Only from' attributes selected).  Thanks! ...
Score 'objWshShell.Exec
Kevin Wheeler - 10 Jan 2006 2:44 PM - 4 messages
Can someone please tell me whats wrong with this line of code? Set objShellExecSet = objWshShell.Exec("cmd.exe /c set|find /i " & Chr(34) & "SystemDrive" & Chr(34)) I'm getting the following error when running it from a Windows 2000 OS.  It ...
Score login/ logout from AD
sheli - 10 Jan 2006 11:05 AM - 3 messages
Hi to all. I'm new to scripting and I'm trying to find a script for login / logout from active directory using a web page. Have you got anything on this? Any help is appreciated. Thanks. ...
Score Understanding Script.
Vipul Raval. - 10 Jan 2006 6:37 AM - 2 messages
Hi, i am new to scripting. i am trying to create a login script in group policy. this is the smaple script i found from internet. I was unbale to understand the script entirely. I am just confused about the Min excution code part can ...
Score use logon script to run exe files
TomKing - 10 Jan 2006 1:42 AM - 2 messages
I have a software that can display user printing credit balance. It's a exe file.  So I put WshShell.Run("c:\folder\file.exe") in the logon script. When I tested it's working the program runs and working fine. But in the logon ...
Score [MSH] Accessing named capture group from match-string
Keith Hill - 9 Jan 2006 10:07 PM - 9 messages
I'm trying to process a bunch of HTML files and I want to extract certain ANCHOR tags so I can sort/unique them like so: match-string "<a\s+href\s*=\s*`"ms-help://(?<URL>.*)`"" foo.html ...
Score need last logged on time for computer object, not user
Jimmy D - 9 Jan 2006 9:40 PM - 8 messages
i have the following script that gets me the last logged on time for all users in a 2000 domain. i need this to give me computers instead... we want to delete computer accounts that have been inactive for 30 days. can anyone ...
Score Unique Filename
Bob - 9 Jan 2006 6:55 PM - 9 messages
How can I add the system time to the filenames of my log backup script?  The script already names the log backups with the Day, Month and Year but I want to add the current time to make the filenames more unique. ...
Score [MSH] So Where's the New Drop?
Thomas Lee - 9 Jan 2006 5:45 PM - 7 messages
Inquiring minds want to know... Thomas ...
Score [msh] Select-object Usage
//o// [MVP] - 9 Jan 2006 3:36 PM - 8 messages
I have the following situation, (using WMI because it is remote) $MP = get-wmiobject -computer computer cim_datafile -filter "Drive = 'i:' AND Extension = 'mp3'" this gives me a list with all MP3's on the disk. now I do some processing. ...
Score Script to install a printer with settings exported from file dat
SP - 9 Jan 2006 3:21 PM - 3 messages
I must  install a printer in a set of computer and set the special redirect port (redmon) properties as in my computer. I've try with these: RUNDLL32 PRINTUI.DLL,PrintUIEntry /ia /m "Apple Color LW 12/660 PS" /n ...
Score [MSH] I think it is a Bug with Trimend
Melf - 9 Jan 2006 11:41 AM - 3 messages
$f="O, Yeah! Ultimate Aerosmith Hits (disc 2)" MSH>$f.TRIMEND('(disc 2)') O, Yeah! Ultimate Aerosmith Hit         Notice how it cuts off the "s" Any reason for this? or is it a bug? ...
Score Logon hanging
TomKing - 9 Jan 2006 6:46 AM - 3 messages
My logon script keep hanging when I logon any win2000 pcs. I put the script in GPO so I can save the script in a hidden share. It's working pretty fine in XP. But hanging in win2000. Here is my code, could anyone give some suggestion? ...
Score [MSH] Minor typo in MSDN Documentation
Thomas Lee - 8 Jan 2006 11:48 PM - 5 messages
Not sure where to post this, but there's a small typo at [link] nad_conc/html/1a3e634e-b66f-4736-a0db-55a00710b298.asp (sorry if line wraps). ...
Next »