Home All Groups Group Topic Archive Search About



Scripting for Windows Server

microsoft.public.windows.server.scripting
Score [PS] Implictions of a PowerShell naming clash
Andrew Watt [MVP] - 13 May 2006 5:05 PM - 4 messages
I am a little concerned about how functions take execution precedence over cmdlets. See my blog post at [link] for background. If you create a rename-item function it blocks execution of the ...
Score [PS] Minor doc bug in GettingStarted.doc
Andrew Watt [MVP] - 13 May 2006 12:56 PM - 3 messages
In the Navigation section of the getting started document reference is made to the get-drive cmdlet. That should now refer to get-PSDrive. Connect bug: 74562. Andrew Watt MVP ...
Score What editors are you using?
Mike Gale - 13 May 2006 10:18 AM - 14 messages
What editors are you using for PS? ...
Score Account Creation
Scott L. - 13 May 2006 1:45 AM - 2 messages
Hi, does anyone have a script that would create a user account in a specific ou, assign a home directory with appropriate permissions, set the password and default group, etc? thanks Scott ...
Score [PS] Undesirable/dangerous behaviour with rename-item?
Andrew Watt [MVP] - 12 May 2006 9:09 PM - 8 messages
Try this: rename-item variable:\MaximumHistoryCount Fred The $MaximumHistoryCount variable is renamed to $Fred. Then try $Fred = 0 and PowerShell complains that you can't set it to 0. Then $Fred = 1 and then get-history and you get multiple entries in the history. ...
Score [PS] Ambiguity in what "accepts multiple values" means in Help files?
Andrew Watt [MVP] - 12 May 2006 8:43 PM - 7 messages
Routinely for parameters the Help files contain an entry "Accepts multiple values?" with a boolean value. It seems to me that the question is perhaps being used in two ways. Let me try to explain where I see the possible ambiguity. ...
Score (PSH) how to make sure a command supports -WhatIf
/\/\o\/\/ - 12 May 2006 8:40 PM - 7 messages
I lost my complete screen while testing this !! cls -whatif ;-) but serious there would be Cmdlets I would want to be sure. would it be an idea to provide an prompt that -WhatIf is not supported opposed to running the command ? ...
Score [PS] Error in Help for rename-item?
Andrew Watt [MVP] - 12 May 2006 8:15 PM - 9 messages
In the Help file for the rename-item cmdlet the default value of the Path parameter is said to be the current location. When using the rename-item cmdlet with only a named NewName parameter a prompt is displayed for a value for the Path parameter. ...
Score Outlook/Exchange determine unread e-mail of users in the doamin
Skamionek - 12 May 2006 7:00 PM - 2 messages
Management wants away to run reports of daily unread e-mail messages in users inboxs.  They want to be able to see if people are not responding to clients. they would like a file be written to the users home drive then be able to ...
Score changing file extensions
nathan reish - 12 May 2006 6:48 PM - 8 messages
i am a novice powershell user.  i want to change a common file extension of a group of files in a folder to another file extension preserving the filename. i know how to do this in unix (or i should say used to)... ...
Score Powershell performance
Jim Shilliday - 12 May 2006 5:45 PM - 5 messages
An experiment-- Using a reasonably large remote folder tree on a machine connected via a T1: using cmd.exe:  "dir /s \\remoteserver\treeroot"  -- 23 seconds for all results. using powershell:  "gci -re \\remoteserver\treeroot"  -- 67 seconds for the ...
Score PowerShell: Feedback wanted for change in default behavior of file creation
James Truher [MSFT] - 12 May 2006 5:36 PM - 14 messages
in previous drops, when redirecting output to a file, we did so in ASCII. With RC1, we changed this to UNICODE.  Has anyone noticed this change?  Do you have any thoughts on this? We did this in this drop so we had time to collect feedback! ...
Score [PS] Wisdom of YAFoW - Yet Another Flavour of Wildcards
Andrew Watt [MVP] - 12 May 2006 3:59 PM - 4 messages
I have been pondering the wisdom (or not) of Yet Another Flavour of Wildcards in PowerShell. At times I find the current implementation a frustrating middle ground. And it seems to go against one of the philosophies of PowerShell, as I understood it - to standardise on high quality ... um ...
Score [PoSh] get-member -MemberType and multiple values
dreeschkind - 12 May 2006 3:22 PM - 5 messages
Hi all, I know there was a question about this before, but wouldn't it be more intuitive/easier for a PowerShell user to use an array for multiple values:   gps | gm -membertype ScriptProperty,AliasProperty instead of using quotes: ...
Score [PS] Any firm news about PowerShell webcasts yet?
Andrew Watt [MVP] - 12 May 2006 7:29 AM - 2 messages
There have been various mentions/hints about upcoming PowerShell webcasts on this list over the months. Is there any firm news about those yet? Thanks Andrew Watt MVP ...
Score Saving a table as .xls using MSH
Irish girl brid - 12 May 2006 6:47 AM - 5 messages
Hi, I'm using MSH to read in an excel table, do some processing of the data and write it to another excel file. Currently I'm using the export-csv, but I would much rather it save as an xls. ...
Score Script that will place a Domain Local group into a Local group
nz50mq - 11 May 2006 8:33 PM - 2 messages
Does anyone have any idea as to how I can create a VBS script that will place a Domain Local group into a Local group? Any and all help would be appreciated very much. ...
Score [PoSh] Out-IE / method named 'IHTMLDocument2_write'
dreeschkind - 11 May 2006 5:59 PM - 3 messages
Has anyone got this working: [link] I get the following error message: PoSh 1 PS:\>get-childitem | select Name,Length | out-html | out-ie ...
Score [PS] - Help with becoming better
ebgreen - 11 May 2006 4:06 PM - 7 messages
Ok, so I am exploring the Power Shell and trying to become more efficient. I can tell that I still think too much like a VBScripter (for one thing having to put functions at the top of the file still annoys me). I do a lot of my ...
Score Use a function to output an object
Matt - 11 May 2006 2:25 PM - 3 messages
I wrote a function to gather information from a Cisco switch using net-snmp, like port name, status and lastchangetime. Can I output this information so I can pipe it to another command, say sort on lastchange time or use something like | where-object { $_.status -eq ...
Score reverse xcopy
Mike - 11 May 2006 1:27 PM - 8 messages
Hi, I'm looking for a batch/script to schedule that compares multiple matching source and destination folders (plus subfolders and wildcards) and deletes any files/folders from the destination that do not exist in source. ...
Score PS Error Messages
Jeffrey Snover [MSFT] - 11 May 2006 1:21 PM - 5 messages
We are going to have to lock down our error messages pretty soon so that we can start the localization process.  Now is the time to speak up if you find any of our error messages useless or could use improvement.  I would GREATLY ...
Score [PS] Remove-item ... I must be missing something
Andrew Watt [MVP] - 11 May 2006 1:11 PM - 9 messages
After the recent post about aliases I started playing with aliases and ways of removing them. One variant, which successfully removes all aliases if run from the command line is: remove-item -Path Alias:\* -Include * -force So far, so good. ...
Score [PS] Usage of international chars
RikardN - 11 May 2006 10:01 AM - 9 messages
Hi all, I just wonder about the support for international chars in PS. I run the command: PS> dsquery group "dc=example, dc=local" -name "group name" | dsget group -members | dsget user From a PowerShell and I guess the DN of the fifth user I get as a result ...
Score [PS] Script failed due to call depth overflow - Image1.jpg (0/1)
Andrew Watt [MVP] - 11 May 2006 9:34 AM - 7 messages
I received the error message in the post's title when exploring the $MaximumHistoryCount issue. Here is the full transcript of the MSH session (except for commands 1 and 2): <begin transcript> PS C:\Documents and Settings\Andrew Watt> get-history ...
Score how do i?
sysadmin - 11 May 2006 9:26 AM - 2 messages
I would like to: a) Determine the IP address of a network host using FQDN b) Use the answer from (a) as part of the parameter of another command, eg. myutilcommand /a /b <IP address> /c where myutilcommand is any command-line tool that accepts an IP address as ...
Score [PS] Command crashes/closes PowerShell consistently
Andrew Watt [MVP] - 11 May 2006 9:23 AM - 9 messages
I was exploring whether it was possible to get a clear-history effect and ran the following: $MaximumHistoryCount = 1 | clear-host and the PowerShell console closes. This is consistent on my machine. Can anyone else repro this? Thanks Andrew Watt MVP ...
Score Powershell won't run!
Patrick_Kägi - 11 May 2006 9:01 AM - 13 messages
if i like to run powershell (from shortcut or from cmd.exe) the shell closes imediately! like: C:\Documents and Settings\pkaegi>powershell Windows(R) PowerShell Copyright (C) 2006 Microsoft Corporation. All rights reserved. C:\Documents and Settings\pkaegi> ...
Score [PS]How can I clear history?
applepwc - 11 May 2006 7:54 AM - 8 messages
I use $MaximumHistoryCount=1. But there is still one memorize. Is there other method to clear powershell history? Btw: 1,How can I check $MaximumHistoryCount valid value like Jeffrey Snover do with "out-file -encoding" example? 2,If I do $MaximumHistoryCount=$null,powershell will crash.Should I bug this? ...
Score WSH and NT 4.0
Tcs - 10 May 2006 10:46 PM - 4 messages
I don't recall, and can't seem to find the answer.  Does WSH come installed on NT 4.0?  Or do I have to install it?  Is it possible to determine if it's installed remotely?  We have several NT 4.0 boxes, ...
Score VBScript INT Type Mismatch
bxr222 - 10 May 2006 7:11 PM - 4 messages
Hello All, I am trying to pull a value out of a table and assign it to a variable and am getting type mismatch errors. Here is how I am trying to retrieve the value: intLocation = Cint("Select Location_ID from Locations where ...
Score typeof() in PowerShell?
Alan Stevens - 10 May 2006 6:12 PM - 4 messages
I am attempting to use PowerShell to make batch updates to workitems in team foundation server.  I have converted a C# program for the task, and have gotten this far: $key = gp HKLM:\SOFTWARE\Microsoft\VisualStudio\8.0 $dir = [string] (gp $key.InstallDir) ...
Score PS Tab Completion
Matt - 10 May 2006 4:41 PM - 2 messages
Any chance that a double-tab will bring up a list of all matches? Sort of like bash, when you hit tab twice you can see all filename matches instead of just cycling through them. Is this something that can be added on? Where is the documentation for how ...
Score searching users
Henry - 10 May 2006 3:55 PM - 5 messages
Hello I have an excel sheet of SamAccountNames. All these users in Excel are scattered in different OUs under mydomain.com I have googled for very long time, but failed for sample script. Mind someone help me guide to obtain Exchange home server name for these ...
Score monitor folder share sizes
Thomas - 10 May 2006 3:24 PM - 3 messages
I'm looking for a solution, utility, batch file, whatever that can monitor the size of their share (nightly), generate a compact log file (.csv, maybe?) and maybe even append the log file each night with the latest stats. This way I could easily generate monthly reports, provide them to the client ...
Score Will there be a separate NG for Exchange PowerShell?
Andrew Watt [MVP] - 10 May 2006 2:57 PM - 2 messages
Just thinking ahead a little. Exchange 2007 has ~350 cmdlets not in the "core" PowerShell distribution. So will Exchange 2007 posts better belong to (making this up) microsoft.public.Exchange.admin.PowerShell? As additional products add PowerShell cmdlets specific to those ...
Score Help with Formatting Powershell
jwashburn - 10 May 2006 2:48 PM - 6 messages
How would I break up this script so that its not all one line, so that its easeir to read get-wmiobject -class Exchange_Mailbox -Namespace ROOT\MicrosoftExchangev2 -ComputerName SERVENAME | select-object MailboxDisplayName,TotalItems,Size | sort -descending "Size" | convertto-html | out-file test.html ...
Score Powershell Output
jwashburn - 10 May 2006 2:36 PM - 13 messages
I cant figure out how to output HTML from powershell. Here is what I did with vb.  It basically connects to our Exchange server and pulls back an HTML file with mailbox name, size, etc.  The problem is I could never get it sort in Descending order.  The largest ...
Score passing "/" with a LDAP query
Demolition_Unit - 10 May 2006 1:13 AM - 2 messages
Hi there, i just need some help with an LDAP Query. I am writing a VB Script that prints out all the members of a Distribution list/Security group, and also prints out their details such as name, email, title, etc for security purposes. ...
Score Powershell performance
Vinicius Canto - 9 May 2006 11:52 PM - 21 messages
Hi guys, Someone know any hack that minimizes initialization time of Powershell? I have an P4 1.8Ghz 512Mb Ram in fresh installed Windows Server and Powershell waits 5 seconds to show the prompt and became ready to receive my orders. Ok, there's a complete framework being loaded, but 5 ...
Score [PS] Current Directory set to MSMAPI\1033\
Marty List - 9 May 2006 11:26 PM - 2 messages
Each time I launch a new instance of powershell, it opens with a current directory of "C:\Program Files\Common Files\SYSTEM\MSMAPI\1033\" This just started with the last two builds, and I first uninstalled the previous builds.  Should I file a bug report on this? ...
Score get-wmiobject -FILTER option problem
jfbradfo - 9 May 2006 6:28 PM - 4 messages
I'm trying to use the -FILTER option on get-wmiobject, and I'm getting an error.  Here are a couple of examples (the second example obfuscates actual server names): PS > get-wmiobject -class win32_service -filter "StartMode = Manual" ...
Score ScriptCenter PowerShell Scripts
jfbradfo - 9 May 2006 4:51 PM - 13 messages
I was a little disappointed in the sample PowerShell scripts in ScriptCenter. They all appear to be translations of the equivalent VBScript scripts without really taking advantage of the power and capability of PowerShell.  I've rewritten (not necessarily well) one script as an example.  The List WMI ...
Score Can someone explain why we should need powerscript.
Ronald - 9 May 2006 8:24 AM - 22 messages
Since I can do almost anything with VBS. ...
Score Need output result to a text file... help required.
tito - 9 May 2006 4:50 AM - 2 messages
I am very new to scripting and learnig slowly. I have written a script to get information about all the printers in a server.. script is here On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") ...
Score powershell - copy the most recent file to a given location
Mesan - 8 May 2006 11:57 PM - 5 messages
Disclaimer: As far as I can tell this is still the place to post questions on powershell until microsoft.public.scripting.powershell or microsoft.public.windos.powershell or whatever the new newsgroup will be called is set up.  If I'm wrong, please forgive me. ...
Score typedata for accessControl.
/\/\o\/\/ - 8 May 2006 7:45 PM - 3 messages
this looks like wrong TypeData to me : MowPS>(gi c:\foobar).GetAccessControl() Path                          Owner                         Access ...
Score backup system state
DolfanBolt - 8 May 2006 6:26 PM - 3 messages
found this script and was wondering if anyone could tell me what to do to allow it to accept a directory to place the backup in that contains spaces. It works fine as is but if I edit the last line and enter a directory like ...
Score Remove and install network printers through a script
SA - 8 May 2006 6:20 PM - 2 messages
Hi all, I am changing the location of the server hosting my printers and wanted to know how to remove the existing network printers and install the new printers automatically through a script. Thanks, SA. ...
Score Counting Processors
OldDog - 8 May 2006 4:47 PM - 12 messages
I have seen a few mentions of this in the past, but I am still looking for an answer. If a machine has  2 Xeon(TM) processors WMI will report that it has 4 processors. I know it's all about the Hyper-Threading, ...
Score Dynamic profile loading
ebgreen - 8 May 2006 4:00 PM - 3 messages
Is there a way to dynamically force the profile to reload in a session. Right now I am doing a lot of exploring and I will often want to add something to my profile. It would be nice if I could force the profile to reload without ...
Score 2003 server logoff script?
Richard Edwards - 8 May 2006 9:10 AM - 2 messages
How do i go about adding a logoff script for a specific user? Thank you. Richard ...
Score Missing some cmdlets
JuergenK - 8 May 2006 7:40 AM - 7 messages
Hi all, in previous versions i've seen references to cmdlets like out-chart,out-grid,out-email. There has also been a way to implement an AD provider : new-provider -Assembly "c:\program files\msh\system.management.automation.commands.directory.dll" -provider ad ...
Score DOC errors for get-drive ???
proussin - 8 May 2006 5:45 AM - 5 messages
I'm new and a search didn't turn up everything so I may be asking an already answered question. In the Powershell Getting Started doc file I find a reference to get-drive which fails in the shell. I found a alias table that list get-PSdrive that works. ...
Score Please rename the .ps1 extension in PowerShell
Stephen - 7 May 2006 9:08 PM - 3 messages
Hello, I hope someone from Microsoft can re-evaluate the extension .ps1 ? It's unusual to use a number for well known extensions. What worries me more is the confusion between the letter "1" and "l" in some fonts. Why not just .psh, .pow, .mps ? ...
Score [PoSH] - Hosting PowerShell
cain - 7 May 2006 1:45 PM - 5 messages
Hi, I'm working on writing a PowerShell host, at the moment I'm just doing a very simple prototype so I can work out what I can and can't do, how best to do things, etc.  So far things are going pretty well except for one problem that I can work around, but only in a fairly ugly way and I was hoping I might be able to find something better. The problem is that I want the user to be able to manipulate some of the elements of the GUI using PowerShell scripting, but it seems that when I run the powershell commands, it executes on a different thread and so then it throws an exception when it tries to modify a UI element (e.g. changing the text of a text box).  Is there any way I can get it to execute on the calling thread? ...
Next »