Home All Groups Group Topic Archive Search About



Scripting for Windows Server

microsoft.public.windows.server.scripting
Score Syntax question / childitem -filter
PDXScripter - 29 Apr 2006 11:35 PM - 4 messages
I have no problem using a filter with $docs = childitem | where{$_.name -like "*.doc"} but for the life of me I can't get any filter syntax to work to do the same thing directly on childitem as $docs = childitem -filter ????? ...
Score "Say Goodbye to Monad"
McKirahan - 29 Apr 2006 2:06 PM - 2 messages
Say Goodbye to Monad ... .... and say hello to Windows PowerShell. It's the same new command shell you've grown to love, only with a new name. And now with less than half the calories of other command shells! Well, OK, the calories remain the same. But there is a brand-new version ...
Score [PoSh] select-object loses column
dreeschkind - 29 Apr 2006 12:28 PM - 6 messages
Hi, I try to get recently started processes:   gps | sort starttime | select name,starttime The problem is that PoSh loses the starttime column when the list is sorted in ascending order. I think the problem is that the get-process can't access ...
Score [PoSh] get-item inconsistency with psdrive cert:
dreeschkind - 29 Apr 2006 11:40 AM - 4 messages
get-item works with "function:", "variable:", "env:", "hklm:", "C:", etc. but it does not work with cert: PoSh C:\>get-item cert: Get-Item : Cannot process argument because the value of argument "path" is invalid. At line:1 char:9 ...
Score [PoSh] set-location with psdrive globbing
dreeschkind - 29 Apr 2006 11:36 AM - 7 messages
Hi, I load a bunch of psdrives as shortcuts to various drirectories on my filesystem in my profile at PoSh startup. The drive names tend to be quite long for descriptive reasons, so I tried to use drive name globbing with set-location cmdlet... and it didn't work. ...
Score PowerShell / get-childitem behavior....
PDXScripter - 29 Apr 2006 7:14 AM - 3 messages
It's a bit of a pain in the ass that if you do something like: $docs = get-childitem|where{$_.name -like "*.doc"} When you are attempting to then do:     foreach($doc in $docs){...} Only to find out that $docs.GetType() is a "System.Object[]" if there ...
Score Automating Local Security Settings
Joseph - 29 Apr 2006 12:10 AM - 3 messages
I'm working on windows 2000 servers trying to modify "log on as a service" in the local security settings to add new users. What would be the best way of automating this? Would scripting work like wmi? Thanks in advance, ...
Score How to assign second set of user shares using logon script
salrimon - 29 Apr 2006 12:02 AM - 5 messages
my Problem:  I'm not very versed in scrpting and I need to setup a new user's folder for all 90 users seperate from the one already assigned by default within the AD user account setup. My purpose:  setting up email archive folders where all users can dump their ...
Score [POSH] ExecutionPolicy: PerUser or PerMachine
Keith Hill [MVP] - 28 Apr 2006 9:35 PM - 8 messages
Shouldn't the ExecutionPolicy be stored under HKCU instead of HKLM?  I know that Windows tends not to be multi-user but in terminal services scenarios it is multi-user.  In that scenario do you want one user to dictate to the ...
Score Security and monad
Wesley H - 28 Apr 2006 7:19 PM - 45 messages
I am trying to get all the shared folders on my machine to tell me what the permissions are for each on. I would like to add it to this command that displays them but i have not found a command that will give me this ...
Score Changing the Domain of a workstation
Fernando Macedo - 28 Apr 2006 6:08 PM - 2 messages
Hello, I'm trying to change the domain from several computers (near 480), then I wanna do a script to remote connect at each computer changing the domain and renaming all users profiles of this computer. Someone can help? Tks, ...
Score [PSH] Methods/functions and blank spaces
Vasu - 28 Apr 2006 4:49 PM - 15 messages
Looks like something is either broke or changed by design. Has anyone else observed this? The only difference between the working and the non-working statement is the "blank space" after the word split and before the parenthesis. --------------- Example begin -------------------------- ...
Score PS Write-Warning color options?
Flowering Weeds - 28 Apr 2006 4:03 PM - 4 messages
Does PS always use only Yellow for the warning message color? Perhaps write-warning could also have the -foregroundcolor/backgroundcolor options? ...
Score PSH Tutorials
Greg Young [MVP] - 28 Apr 2006 2:09 PM - 3 messages
looking for some good PSH tutorials, mainly need syntax, high level view, etc (don't need how arrays work, etc :P) Cheers, Greg ...
Score [PS] User Guide inconsisent on -match operator
forestial - 28 Apr 2006 1:28 PM - 5 messages
In the Windows PowerShell User Guide there are two statements about the -match operator that are contradictory: On page 78, it says -Match uses the .NET regular expression object to determine whether a string contains a pattern.  If a match is found during the operation, the ...
Score scheduled task and output files
akkha1234@gmail.com - 27 Apr 2006 11:59 PM - 6 messages
I am a new Windows guy although I have been using UNIX for the past ten years. I am running some batch files using scheduled task and I put in something like this:    c:\batch\test.bat 1>c:\output\test.txt 2>&1 ...
Score [PS1] self-signed
Mark Ayers - 27 Apr 2006 10:36 PM - 7 messages
Rather than loosen security to RemoteSigned, as I had originally done, I finally decided to start signing my own scripts and move to AllSigned. Once I had a self-signed certificate as described in about_signing I whipped this wee thin wrapper over Set-AuthenticodeSignature. It speeds the job for me as ...
Score Compilation error and exception
Varun Bansal - 27 Apr 2006 8:34 PM - 3 messages
Hi All, I want to understand the correct sequence to create a runspace to invoke cmdlets from c# code. As per MSDN, the single line RunspaceInvoke invoker = new RunspaceInvoke(); should build all data structures that are needed for the runspace and for invoking commands but the sample code gives a ...
Score (PSH) dance of the Shells
/\/\o\/\/ - 27 Apr 2006 7:07 PM - 10 messages
the fight to get the console is still there (and funny): [System.Diagnostics.Process]::start("cmd.exe",$null,$null,$null,$null) I will add the bug again on connect. gr /\/\o\/\/ ...
Score [POSH] No table headers for Get-ItemProperty
Keith Hill [MVP] - 27 Apr 2006 7:01 PM - 3 messages
If I execute "Get-ItemProperty ." in the registry, wouldn' t it help convey the difference between items and item properties if POSH displayed this: 19# Get-ItemProperty . Name               Value ...
Score WSH scripts may fail when launched via PS instead of CMD
Oisin Grehan - 27 Apr 2006 5:12 PM - 5 messages
repro steps: -- begin test.js -- var oWsh = new ActiveXObject("wscript.shell"); var sFilePath = oWsh.CurrentDirectory + "test.xml"; WScript.Echo(sFilePath); -- end test.js -- results differ when executed via cmd.exe versus powershell.exe cmd: "c:\path\test.xml" powershell: "c:\pathtest.xml" ...
Score Insert a letter into a string in VBScript
OldDog - 27 Apr 2006 3:31 PM - 3 messages
Hi, The powers the be (PTB) where I work have decided that from now on all ILO cards will be named with an "R" as the 5th charactor in the name. I need to be able to modify my current scripts so that they can locate ...
Score Copy only newer files
RollNpc - 27 Apr 2006 3:28 PM - 3 messages
I set up a small batch file using the replace command with the switch of /u to copy all  files from a network share that are newer than the files on a local drive. this worked great for days and now after running the command it ...
Score ASP programming...
zagi - 27 Apr 2006 9:49 AM - 3 messages
Can someone tell me some newsgroups for ASP programming ? ...
Score Changing path of My Documents folder
Sergio Garcia - 27 Apr 2006 9:39 AM - 2 messages
Hi All,     I've got a doubt. I want to change the path of the folder My Documents in the logon of the user. I want that instead of C:\docs\ that they've got now, they have the usual an typical C:\Documents and settings\%username%/My ...
Score VBS design
jun - 27 Apr 2006 3:35 AM - 2 messages
I want to repair a batch of file. The repairing time may be short or long. So I have to wait a time to move the repaired file to the source file. But I have difficulty to get the end time of the command running. ...
Score when create schedule task, how to make it can wake the computer?
Moosdau - 27 Apr 2006 3:24 AM - 2 messages
Dear all:   If I  create a task from the guide, we could choose " wake the computer to run this task" , but if I create from wmi, there is not such a argument to set this option. Could anyone tell me how to do that through wmi ? ...
Score get the end time of a running command
jun - 27 Apr 2006 3:22 AM - 2 messages
Is there any way to get the end-time of a running command? ...
Score (PS) DOC Bug: Windows PowerShell RC1 release notes
DBMwS - 26 Apr 2006 11:45 PM - 2 messages
While in "Cmdlet name changes" section, # CMDLET RENAME: Import-SecureString -> ConvertTo-SecureString # CMDLET RENAME: Export-SecureString -> ConvertFrom-SecureSring If you scroll down to tables under "Class renames" section, You will see "Export-SecureString; Import-SecureString" for Cmdlet Names ...
Score PowerShell: Prior Use of the Name
Mark Ayers - 26 Apr 2006 10:46 PM - 2 messages
I wonder at all of the current software carrying the PowerShell name. The list includes programs written for Windows by other than Microsoft. Strange choice. Much confusion ahead. I think it is a shame too since Microsoft Command Shell and MSH were doing a ...
Score (PS) for the Sweep team :
/\/\o\/\/ - 26 Apr 2006 8:40 PM - 3 messages
for the Sweep team : Microsoft Command Shell (MSH) Programmer's Guide [link] gr /\/\o\/\/ ...
Score Script to disable netbios.
winter - 26 Apr 2006 6:42 PM - 4 messages
Hi is anyone know the script to disable netbios on Xp machine Thank you kindly ...
Score Automating Windows XP Activation after RIS installation
Sony311 - 26 Apr 2006 5:55 PM - 4 messages
Does anyone have a script that will automatically activate Windows XP once the RIS installation is completed and the user logs in for the 1st time only? I have legit product keys, but I do not want to manually activate each and ...
Score Randomly generated password across multiple systems
graymeiste - 26 Apr 2006 5:47 PM - 2 messages
I'm trying to find a way to generate the same random password locally on multiple systems using some key element that can be present on each system (e.g. system setting or data read from a flat file to be used as seed data, ...
Score logon script
Martin - 26 Apr 2006 5:16 PM - 8 messages
Hello !! I am battling with a logon script.... I would like to modify the registry when a user logs on. The trouble I 'm having is that some of the client machines are windows 2000 and some are XP pro as well as windows 2003. ...
Score Random psh stuff.
William Stacey [MVP] - 26 Apr 2006 4:58 PM - 7 messages
1) Powersh.exe used in places in the docs. Should be Powershell.exe I guess. 2) Microsoft.PowerShell_Profile.ps1 - Could that be any longer? 3) "The profile Microsoft.PowerShell_profile.ps1 will only be run for the shell with the matching ShellID..." ...
Score Stumped on WScript.RUN issue
Fran <> - 26 Apr 2006 4:53 PM - 4 messages
I have a simple script that runs a setup utility to install an app for a user:    objShell=CreateObject("wscript.shell")    strCommand="F:\setup.exe"    intReturn=objShell.Run(strCommand,1,True)    If intReturn<>0 Then ...
Score What is the equivalent in Powershell
Melf - 26 Apr 2006 4:52 PM - 3 messages
I was trying to fix some old scripts so what is the equivalent of new-object system.management.automation.mshobject ? ...
Score (PS) delays after idle-ing
/\/\o\/\/ - 26 Apr 2006 4:43 PM - 2 messages
In Monad and also in PowerShell, after I leave the PS session idle for a long time, (as my computers stay on at night this happens often) when I start working again PS will react very slow. this will get better after a while but never completely goes away. ...
Score Change password for specific users in AD every 30 days
Filip@work - 26 Apr 2006 2:38 PM - 7 messages
Hey, I'm new at scripting and I need some help from you guys. I need a script in which I can set the change password at next logon for different users in different OU's every 30 days. Example: ...
Score powershell logo
klumsy - 26 Apr 2006 2:20 PM - 3 messages
i had a friend whip up a powershell logo for me (and eventually put analyzer on it, for the splash screen of powershell analyzer) you can see it here [link] i'm tempted to add a subtitle to it ...
Score disabling NT accounts
w62 - 26 Apr 2006 10:42 AM - 2 messages
Hi, I am trying to locate or create a script to disable and add a description to NT4 accounts that haven't been accessed for 90 days. I already have an excel spreadsheet with the names in, but am really struggling. ...
Score [MSH] How do I get rid of the MonadLog in eventvwr
Harald Ums - 26 Apr 2006 10:20 AM - 6 messages
1) Msh installed an additional custom Logfile for the eventvwr - how do I get rid of this 2) Same with PowerShell: there is new Eventlog for Powershell: I want the data in the application log not somewhere else. BTW these multiple Logfiles for applications are starting to be major cause ...
Score Robocopy vs. Windiff
Oscar Otto - 26 Apr 2006 10:16 AM - 6 messages
Hello, I'm having the following problem: I have a script that runs every night to backup all changed files on a server to a USB harddisk which is changed daily. I'm using robocopy for this action with the following syntax: ...
Score file transfer - facing problem
yamu_rhyme - 26 Apr 2006 6:01 AM - 4 messages
Hi members,       When I execute ftp commands in cmd prompt(ftp>) my lcd command is working fine and I can very well transfer my files from my machine to server. Whereas, when i put the same commands in my asp file, its ...
Score cutting parts of words separated by - and pasting to a new column using MSH
Irish girl brid - 26 Apr 2006 2:07 AM - 4 messages
Hi, I've been trying for a few days to do this and I can't figure it out. I'm pretty new to this so I'd appreciate some help. I have an excel sheet.  One of the colums has a description that looks ...
Score PowerShell Question
Melf - 26 Apr 2006 1:31 AM - 2 messages
Since Powershell is not going to be shipped with with Vista Client and I can understand why it is not.  I was wondering if it is going to be shipped with vista server since there appears more then enough time to include it.  And if ...
Score $pshome bug
klumsy - 25 Apr 2006 10:36 PM - 12 messages
$pshome has followed the bad behaviour of its earlier incarnation ($mshhome) in showing the directory where of the hosting exe, rather than the installed location of powershell (i.e in powershell analyzer if will show my directory , or if you copy ...
Score PS still has MSH Icons
Flowering Weeds - 25 Apr 2006 10:18 PM - 3 messages
Did someone forget to tell the artist? ...
Score PowerShell slashdotted. Again :)
Grzegorz Niemirowski - 25 Apr 2006 10:07 PM - 4 messages
With my little help PowerShell has been announced on Slashdot. I hope there are not many language mistakes :) ...
Score PowerShell Analyzer alpha is out
klumsy - 25 Apr 2006 9:14 PM - 3 messages
if you want in the alpha team, go here and leave a comment with your email address (which i'll keep safe). If you are already in the alpha team you should already have mail. cheers, [link] ...
Score [MSH] Local and remote cmdlet access in PowerShell v1?
Andrew Watt [MVP] - 25 Apr 2006 9:01 PM - 4 messages
I have been listening to an Exchange 12 webcast this evening. One of the interesting snippets of information is that 90% of "Exchange cmdlets" (my term) can access a remote machine. My understanding is that "ordinary" PowerShell v1 wasn't to have ...
Score [MSH] What is the scope of "PowerShell"?
Andrew Watt [MVP] - 25 Apr 2006 8:53 PM - 3 messages
If "PowerShell" is the new shell what is the scripting language now called? Thanks Andrew Watt [MVP] ...
Score [MSH] Document bug - Snapins Help File
Andrew Watt [MVP] - 25 Apr 2006 8:44 PM - 2 messages
The Snapins help file still refers to MshSnapins in the file title. Andrew Watt [MVP] ...
Score [PS] Vista Install Issues
Keith Hill [MVP] - 25 Apr 2006 8:10 PM - 9 messages
First thing is that the installer needs to be authenticode signed with the Microsoft cert so that we don't get this omninous warning on install: Vista should at the very least be able to determine that this software package's publisher is Microsoft. ...
Score my first 3 Windows PowerShell Commands
/\/\o\/\/ - 25 Apr 2006 6:52 PM - 6 messages
My  first 3 Windows PowerShell Commands $host.version PS G:\MOWSH> $host.version Major  Minor  Build  Revision -----  -----  -----  -------- 1      0      9567   0 ...
Score (PS) RC1 bit Windows Power SHell are there
/\/\o\/\/ - 25 Apr 2006 6:21 PM - 3 messages
X86 latest build: [link] X64 latest build: [link] Documentation: [link] ...
Score [MSH] The new name is: Windows Power Shell
Keith Hill [MVP] - 25 Apr 2006 3:39 PM - 74 messages
The file extensions for script files will change to .ps1 where the 1 is used to indicate version information to the shell.  Presumably if there is a breaking change in the product the file extension would change to .ps2 or ...
Score [MSH] Suggestion: get-command -Group "sql"
Michael Lewis - 25 Apr 2006 2:35 PM - 9 messages
There's lots of cool stuff in msh.  Much of it exposed from the cmdlets, of which there are already well over 100, and that list is growing fast. Imagine a time in the (near) future where msh has really taken off: cmdlets ...
Score Open a Word Document
Luiz - 25 Apr 2006 12:28 PM - 4 messages
Hi, I would like to know how can I create a script to open a new Word document with a name, like Test.doc. I am a "newbie" in scripts stuffs. Thank you for while. Luiz ...
Score [MSH] Any timing for official name for Monad yet?
Andrew Watt [MVP] - 25 Apr 2006 8:11 AM - 9 messages
When the Monad newsgroups were moved here about 6 or so months ago mention was made of an upcoming official naming of Monad. Are we close to that yet? Thanks Andrew Watt [MVP] ...
Score Searching Locked accounts in Windows Server 2003
Shirin - 25 Apr 2006 7:54 AM - 3 messages
I have already tried following conditions, but didn't find correct results. 1) (&(objectCategory=user)(!sAMAccountName=*.service)(!sAMAccountName=*.admin)(!userPrincipalName=*.service)(!userPrincipalName=*.admin)(userAccountControl:1.2.840.113556.1.4.803:=16)) 2)(&(objectCategory=Person)(objectClass=User)(lockoutTime>=1)) ...
Score Csvde - random passwords
jering - 25 Apr 2006 7:26 AM - 3 messages
Hi! I currently have a script making AD-users using csvde based on a Excel-sheet. There after, a vbs-script runs and activates the users: Option Explicit Dim objOU, objUser, objRootDSE, objShell Dim strContainer, strDNSDomain, strPassword Dim intCounter, intAccValue, intPwdValue ...
Score What is the best way to do the following add users task.
Joam - 25 Apr 2006 3:41 AM - 2 messages
we get 1000 user account to add. the user name is in an excel table. every user have a folder (folder name is user name) on D drive with 100MB quota. Only himself and admin read and write permittion also mapping to his ...
Score Robocopy /XD switch with wildcards?
ML.net - 24 Apr 2006 4:25 PM - 3 messages
Does anyone know how to use Robocopy.exe using the exclude directory switch using wildcards? I've seen mixed information out there about the ability to do it. Here is a snippet from my script. robocopy.exe c:\source c:\target /XD c:\target\custom ...
Score Change Password at next login
Shaun W - 24 Apr 2006 4:08 PM - 6 messages
Hello, I am trying to figure out a way to have a script set "Change Password at Next Login" for a whole OU.  I know how to do it for one user but not all users in an OU.  Any help with this would be greatly appreciated. ...
Score Applying windows updates by script
Jay - 24 Apr 2006 9:37 AM - 3 messages
Guys I look after about 50 Windows servers, and there are more being added. We're using WSUS to control the distribution of updates, but the job of installing them and restarting machines in a managed way is becoming a bit like hard ...
Score Scheduled Tasks hangs when it runs a batch file
Maxwell2006 - 24 Apr 2006 2:39 AM - 2 messages
Hi, I have a batch file that takes around 90 min to run. When I run the batch file from command prompt, it works file and normally finishes in 90 min. When I schedule the batch file through Scheduled Tasks, for some reason it ...
Score [MSH] get-eventlog EntryType
Andrew Watt [MVP] - 23 Apr 2006 8:43 PM - 3 messages
When using the get-eventlog cmdlet with the group-object cmdlet in a pipeline an EntryType of 0 is displayed (as well as the expected entry types). What does this 0 type correspond to, if anything, in Event Log? Thanks ...
Score [MSH] Should Set-Location -Verbose return a PathInfo object?
Alex K. Angelopoulos [MVP] - 23 Apr 2006 8:09 PM - 3 messages
Set-Location doesn't return any output under any circumstances that I can see. Does anyone else see a reason to provide a way to get the path back? The default of no return value makes sense in general since we can check ...
Score [MSH] No root for drives from "flat" providers?
Alex K. Angelopoulos [MVP] - 23 Apr 2006 5:25 PM - 5 messages
When I use Get-Drive/MshDrive, I noticed that the providers which have flat namespaces don't show a root: e.g., Alias:, Env:, Function:, Variable: The cert: drive does show one, and it is \. Shouldn't these providers define a root as well, even though you can't ...
Score [MSH] technique for invoking functions by provider path?
Alex K. Angelopoulos [MVP] - 23 Apr 2006 4:53 PM - 8 messages
Is there an easy way to invoke a function via its provider path? It's possible to specify any external executable (including non-MSH scripts with appropriate interpreters and pathext customization) by its complete filesystem path: e.g., we can do this: ...
Score EnableRemoteControl in vb.net
Wuhosting Destek - 23 Apr 2006 1:28 PM - 2 messages
hi I am making a program for our automation and I need to change EnableRemoteControl property via vb.net code is below Dim obDirEntry = New DirectoryEntry("WinNT://" + Environment.UserDomainName) Dim entries As DirectoryEntries = obDirEntry.Children Dim obUser As DirectoryEntry = entries.Add(user_name, "User") ...
Score how to copy file or folders to %systemroot% or %programfiles%
אבי - 23 Apr 2006 1:16 PM - 9 messages
Hi, how acn i make a script that can copy file or folders to those location %systemroot% or %programfiles% Thanks ...
Next »