Home All Groups Group Topic Archive Search About



Scripting for Windows Server

microsoft.public.windows.server.scripting
Score PowerShell remote exec
DDDB - 6 May 2006 5:58 PM - 3 messages
Is there any way to remotly execute program usin Microsoft PowerShell, any sample if possible ...
Score Run Script only once
Sasi - 6 May 2006 2:22 PM - 2 messages
I want a script to be run for a user only the first time he/she logs on to my Domain.how can i do this.if I but that script in his/her logon script,it would be run so many time,which I don' want.what should I do? ...
Score [PSH] excessive number of alias break programs and scripts
Harald Ums - 6 May 2006 7:29 AM - 15 messages
while playing around with powershell I saw there are 101  aliases in the default installation - 71 are readonly. These huge amount of aliases effectivly work like reserved keywords and hide other programs: sc:  hides sc.exe service controll needed to start services remotely ...
Score *.format.ps1xml schema
Martseniuk@gmail.com - 6 May 2006 7:18 AM - 3 messages
Is *.format.ps1xml schema documented? ...
Score Windows PowerShell RC1 refresh
Wassim Fayed [MSFT] - 6 May 2006 12:41 AM - 3 messages
Hi, Please note that we have refreshed the RC1 PowerShell release on download center. Microsoft identified two issues that we wanted to address as quickly as possible. Microsoft re-released Windows PowerShell RC1 in order to address two newly discovered issues. Existing users of Windows PowerShell RC1 should ...
Score [PS] Get-Item can't find hidden files?
Alex K. Angelopoulos [MVP] - 5 May 2006 10:34 PM - 9 messages
Is there a way to work around Get-Item not finding hidden files?     PS> $i = get-item c:\boot.ini     Get-Item : Could not find item C:\boot.ini. ...
Score [PoSH] Text Color
ebgreen - 5 May 2006 7:36 PM - 6 messages
Ok, so I'm digging the colored text options for write-host (-forgroundcolor and -backgroundcolor). My question is this. Is it possible to just color a portion of the line of output. What I would like to do is to incorporate this ...
Score [PS] Using select-object with strings as parameters
Alan Taylor - 5 May 2006 6:09 PM - 3 messages
I'm trying to get "select-object" to correctly generate objects fit for a pipeline.  I build up a string to pass to select-object.  However, the output doesn't look correctly. Has anyone been able to get something like "1|select-object $foo_bar" to ...
Score powershell project droped ???
SunChero - 5 May 2006 5:16 PM - 4 messages
the link to download Powershell is no longer  available , for 4 daysnow,specially after the articles became circuling about the first vista virus using PS , it seem microsoft have cut down the link .. so anyone know  if the project still alive or , microsoft is justegoing to ...
Score What is error number -2147016682
CNCKG - 5 May 2006 3:28 PM - 3 messages
What does this error number mean? I'm trying to change attributes to a user account, when I invoke .setinfo I get -2147016682 reported back. There are several attributes that are getting set successfully but four of them keep failing. Specifically the sn, ...
Score printers
Bruno - 5 May 2006 1:10 PM - 2 messages
hi i want to uninistall all the printers on a client. the script Set WshNetwork = WScript.CreateObject("WScript.Network") PrinterPath = "\\myserver\printerxxx" WshNetwork.RemovePrinterConnection PrinterPath, true, true can remove only one printer. how can i remove more than a printer in one shot ...
Score empty a folder
Fabrussio - 5 May 2006 1:03 PM - 3 messages
Hi, how can I empty a dir of everything? thought to empty c:\test it was: del c:\test\*.* /f /s /q but this leaves other folders (and some files) in C:\test RD Removes all directories and files in the specified directory in addition ...
Score PC information
GL Spencer - 5 May 2006 12:51 PM - 4 messages
1.  Very much a newbie in scripting....so please be patient I joined two scripts from the MS technet script center... However the only results I get are the users that are configured for that PC, I do not get any of the BIOS information that I am looking for. In the ...
Score Unresolved "about" references in PoSh on-line help
Seva - 5 May 2006 4:00 AM - 4 messages
There are still a bunch of unresolved "about" references in the on-line help. I know that documentation is still being finalized, but I though may be simple code snippet will save a bit of time and frustration for someone who's ...
Score [PoSH] Using mt.exe with PoSH
Keith Hill [MVP] - 5 May 2006 2:26 AM - 4 messages
I've been playing around UAC manifest files on Vista and I was trying to embed one in an app running on Vista so I tried this from the command line: mt.exe : command line error C1010008: Missing command-line option ...
Score Is there alias for [System.Text.RegularExpressions.RegexOptions]?
Seva - 4 May 2006 8:53 PM - 9 messages
[regex] is a nice alias for [System.Text.RegularExpressions] Is there something similar for [System.Text.RegularExpressions.RegexOptions]? Constructs like [Text.RegularExpressions.RegexOptions]::Compiled -bor [Text.RegularExpressions.RegexOptions]::Ignorecase create quite a clutter in the code. Thanks, Seva. ...
Score [PoSh] Multiline comments?
dreeschkind - 4 May 2006 8:52 PM - 4 messages
Is there a possibility to comment out multiple lines of code in scripts without putting '#' infront of every line, like in C++  ? /* ... ... */ Maybe the # character could be appended like this: #start .... .... #end ...
Score Add local IP Printer error... SWbemObjectEx: Generic failure
pdub - 4 May 2006 8:33 PM - 3 messages
I am using the script below to add a local IP printer. The IP port 10.57.3.3 is  already created. When I run it I get the error "SWbemObjectEx: Generic failure" on the line with "objPrinter.Put_". ...
Score How to run powershell.exe from cmd.exe?
dreeschkind - 4 May 2006 8:12 PM - 10 messages
Hi all, Might sound stupid but how can I run powershell.exe from cmd.exe console? I tried the 'start' command, but it just opens up another cmd.exe console window. C:\>start "C:\Programme\Windows PowerShell\v1.0\powershell.exe - NoExit ...
Score PowerShell newbie question
Michael Kelley - 4 May 2006 7:16 PM - 3 messages
This gives me the results I want - it prints out the "somestring" found in *.cpp *.h recursively searching the current directory: E:\soft\src>gci -i *.cpp,*.h -r | select-string somestring and I would think that the lines below would give me the exact same result - ...
Score set proxy settings in a batch file
todd snyder - 4 May 2006 6:04 PM - 3 messages
I need to set my proxy settings in IE to set my proxy settings to "proxyserver:8080". Bypass [link] ...
Score [PS] printing the contents of a hash
forestial - 4 May 2006 3:05 PM - 11 messages
Create a hash and put some key/value pairs into it: examine the contents Name                           Value ...
Score Download link for PowerShell RC1 is broken
Yosi Markovich - 4 May 2006 11:35 AM - 3 messages
Hi, I am trying to download PowerShell RC1 by following the link that appears at [link] but arrive to an error page saying: "The download you requested is unavailable. If you continue to see this ...
Score Batch Scripting
Matt - 4 May 2006 11:05 AM - 4 messages
Hi, I am required to write a script to connect to a remote server via FTP, download a file to a local server and then FTP the file over to the remote server. I have return a simple .CMD file to do the same. This script would ...
Score Executing powershell on W2k Server
Wesley H - 3 May 2006 9:47 PM - 11 messages
I have a Powershell .ps1 file and I would like to turn it into a script that will run on windows 2000 or if there is a way to get powershell to work on W2k. Is there a way to do this? ...
Score [PoSH] Get-Credential console output
Keith Hill [MVP] - 3 May 2006 8:50 PM - 9 messages
Is there a way to get Get-Credential to not display this? cmdlet Get-Credential at command pipeline position 1 Supply values for the following parameters: Also is there a way to have it get the username/password from the console ...
Score PowerShell and WS-MGMT?
Andrew Watt [MVP] - 3 May 2006 8:36 PM - 3 messages
Long, long ago when PowerShell was called Monad there was mention of Monad working with WS-MGMT, in version 1.0 as I understood things. What is the current situation? Or likely near future situation? Not following this closely, but is WS-MGMT now WSDM? ...
Score Users with pwd never expire, enabled and password is older than 90
Misha - 3 May 2006 8:10 PM - 8 messages
I have the script to enumerate the password never expire accounts and to include only the users accounts which are enabled and not disabled. I would like to include one more option which is to pull the users with passwords ...
Score Some WPS Excel help
ebgreen - 3 May 2006 5:56 PM - 3 messages
Hello all. I am trying to do something that I thought would be quite simple but is giving me headaches. I essentially have an associative array that I want to output to the first 2 columns of the first sheet of an excel file. I ...
Score Use VBS to get IIS FTP TCP Port
matt.b.williams - 3 May 2006 5:11 PM - 3 messages
I am trying to use a vb script (actually it will ultimately be used in VB 6) to obtain the TCP Port and IP Address of an FTP site running in IIS.  Currently I can get the root directory, but obtaining the Port ...
Score get-childitem seems to be broken, no matter what
Seva - 3 May 2006 1:07 PM - 2 messages
I carefully reviewed various prior posts regarding get-childitem behavior and it still does not explain how get-childitem behaves in practice. For example, it's being claimed that -Include option applies to the container, rather than child items inside it. ...
Score RootHints in dns setting
Marek - 3 May 2006 12:03 PM - 13 messages
Hi all, how I add roothints in the dns server ? Thnax marek ...
Score Set of properties for table output
Dmitry Sotnikov - 3 May 2006 9:41 AM - 5 messages
A question to the PowerShell programming experts here: Suppose I want to present a PowerShell object with its basic properties in my own UI. I don't know in advance which object class it is. So I would naturally want ...
Score Power Shell shell startup scripts over network
Brandon Hamm - 3 May 2006 8:50 AM - 7 messages
Power Shell RC1 doesn't seem to play nice with network $home directories.  I was not able to get a $home/My Documents/PSConfiguration/profile.ps1 script to run when $home is located on a network share.  It runs fine when logged ...
Score Windows 2003 Logon Script
salzmannr - 2 May 2006 8:51 PM - 4 messages
Hope to find answers to a couple of questions: 1:  When specifiying a Home Folder in user profile tab in Active Directory say, H to \\servername\homedir\%username%  and you have a logon scipt specified on the same tab, with the script running: ...
Score [PS] Question about -Recurse
Marty List - 2 May 2006 8:22 PM - 7 messages
I'm just curious about the implementation of -Recurse for get-childitem.  After reading this in the release notes: "Parameter binding is changed for "bool" and "SwitchParameter". Previously, the full ETS algorithm for conversion to bool was used. That algorithm would accept ...
Score Help with PowerShell + GData + Google Calendar
Melf - 2 May 2006 8:03 PM - 6 messages
I was trying to user powershell to sync with Google calendar using the api from google. [link] I got this far..... [System.Reflection.Assembly]::LoadFile("C:\gcal\cs\lib\gdata.dll") ...
Score [PoSh] Collecting oneliners/scripts to wow others
dreeschkind - 2 May 2006 6:38 PM - 10 messages
Hi all, Monad/MSH/PowerShell is my default shell for several month now and everytime someone looks over my shoulder, he/she asks me what the hell I'm doing with that 'stupid old dos prompt'. So I have to explain the whole thing over and ...
Score [psh] Upgrade blues
Thomas Lee - 2 May 2006 4:26 PM - 11 messages
I like Monad - but nearly everything the marketing folks have done of late is, well, just plain sub-optimal. In the latest drop I have 4 gripes: 1. PowerShell - who dreamt up this name? It sounds like some shareware add one for win16. And did anyone do a Google search of the name to see ...
Score Trying to reproduce cmd.exe's Dir /b
Jim Foster - 2 May 2006 3:51 PM - 7 messages
Hello, I am very new to PowerShell and I am trying to reproduce something that I can do easily in cmd.exe. I can do   "dir /s /b" and get a listing of files with the full file name. The closest I have been ...
Score Invoking E12 cmdlets from C# code
Varun Bansal - 2 May 2006 3:33 PM - 9 messages
Hi All, Can someone tell me how to invoke Exchange cmdlets from C# code? I'm trying to execute "get-exchangeserver" and it gives me an error: 'get-exchangeserver' is not recognized as a Cmdlet, function, operable program, or script file ...
Score The ICON of the Powershell.exe
hayate - 2 May 2006 2:04 PM - 3 messages
Just noticed the icon of PSH was still a MSH ICON? Will it change? LOL ...
Score [PS] Parameter tab-completion does not work in assignment statement
Alex K. Angelopoulos [MVP] - 2 May 2006 1:25 PM - 7 messages
If you enter the following and hit the tab key:     Get-EventLog -Ne the shell automatically completes -Ne:     Get-EventLog -Newest If you do this, however:     $e = Get-EventLog -Ne You don't get tab-completion. ...
Score (PSH) LanguageQuickReferenceTriFold.doc
//o// [MVP] - 2 May 2006 11:43 AM - 7 messages
in the Monad documentation set, there was this very handy quicksheet : LanguageQuickReferenceTriFold.doc in the PowerShell Documentation set, this quicksheet is gone. as I use this sheet a lot , I think it would be nice to re-add this sheet to ...
Score shell.exec vs cmd line?
joe - 2 May 2006 1:11 AM - 3 messages
Howcome this works from the command line (w2k3): dsquery user -samid %username% -o dn | dsget user -memberof but running it in a script like this fails: set oUserDN = oShell.exec("dsquery user -samid %username% -o dn | dsget user -memberof") Here's what I ended up doing, but I don't understand why I have to split the two commands: ...
Score [PowerShell[ How do I log an event in a script?
David Moisan - 1 May 2006 11:46 PM - 4 messages
Hello, I'm looking for a way to log an entry into the Event Log similar to what's in WSH, to quote a line from one of my VB scripts: WshShell LogEvent constInformational, DisplayMsg I've been looking all over for an equivalent in PowerShell.  Is there ...
Score another good Introduction to PowerShell
/\/\o\/\/ - 1 May 2006 9:05 PM - 2 messages
On computerperformance.co.uk in the powershell (Monad) Home [link] you can find a good Introduction to PowerShell (Monad) and much more info about powershell. enjoy gr /\/\o\/\/ ...
Score Script for correcting the time
Phil Buzzette - 1 May 2006 8:17 PM - 6 messages
I am looking to find out how to have a script run on startup that will go out and retrieve the correct time and apply it to the system so that all our workstations have the correct time. I was told this could be done on a server ...
Score [PS] New PowerShell Newsgroup
Leonard Chung [MSFT] - 1 May 2006 7:03 PM - 32 messages
Hi all, As promised, I'm working to create a new newsgroup dedicated to Powershell discussion. I wanted to get your opinions on what name is preferable to you. Here are the choices: microsoft.public.windows.powershell microsoft.public.windows.server.powershell ...
Score Effectively Using Scheduled Tasks: a joke?
Bkaler - 1 May 2006 6:26 PM - 5 messages
It's aggrivating to me how hard it is to use scheduled tasks effectively.  Largely because of 2 reasons When you run scheduled tasks, you run them as yourself, hence any time the task is scheduled, it fails because you haven't added your ...
Score [PS] emulating awk and sort
forestial - 1 May 2006 6:26 PM - 12 messages
I am trying to extract two fields from a text file and produce a simple tabular sorted output. The input file contains lines like this: solution RtProgLog has 1 warnings I want to extract the solution name (RtProgLog in this case) and the number ...
Score Exception
Varun Bansal - 1 May 2006 6:07 PM - 2 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 [PS] Should Get-Command's -CommandType <CommandTypes> be a list item?
Alex K. Angelopoulos [MVP] - 1 May 2006 5:13 PM - 3 messages
From pluralization it seems clear that the intent is for Get-Command -CommandType to accept multiple types of commands. That would be useful as well. However, it doesn't work: PS> Get-Command -CommandType ExternalScript,Function Get-Command : Cannot convert 'System.Object[]' to the type ...
Score Getting a script to run
ebgreen - 1 May 2006 3:41 PM - 4 messages
I have just installed the WPS beta. I previously had MSH installed and I uninstalled it first. I created a script named C:\test\test.msh. The contents of the script are: "Hello world!" When I run the script using the command: ...
Score How do I use a windows script to get View-Source content?
magnets - 1 May 2006 3:03 PM - 2 messages
I want to read the source of a web page using a scripting language and then write that source to a specific location.  It's an occasional (often daily) one line parameter to be provided via a web page. ...
Score Jscript for Windows Registry
Paul - 1 May 2006 2:29 PM - 2 messages
My goal is to read and display registry information for selected subkeys in jscript at this location. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers I am new to this and am not sure what to use as a resource or what functions ...
Score Form Handling
kpchop - 1 May 2006 1:44 PM - 2 messages
I have a web site on a Windows Server 2003 host. I have a form that collects the usual: name, address, email, etc. When the user clicks Submit, I need the data to be sent to an email address and the ...
Score [PS] Payette's PowerShell In Action - draft chapter available
Alex K. Angelopoulos [MVP] - 1 May 2006 1:39 PM - 7 messages
I think dev team members have already blogged about Bruce Payette's forthcoming book, PowerShell In Action, but here's a direct link to the website for it in case you don't read the blog regularly:     [link] ...
Score [PS] Get-Help handling for functions?
Alex K. Angelopoulos [MVP] - 1 May 2006 1:00 PM - 18 messages
Is Get-Help going to support functions at all in V1? Right now we get no feedback from '-?' and breakage from 'Get-Help': PS> more -? PS> help more Get-Help : Cannot find Help for topic "more". At line:1 char:31 ...
Score [PS] get-wmiobject breaks!
Andrew Watt [MVP] - 1 May 2006 12:24 PM - 2 messages
I have an oddity on one XP machine. I was exploring the get-wmiobject cmdlet fairly intensively and it initially worked happily. Then it just stopped working. I could run a .vbs to, for example, use Win32_Service to display services on a machine. ...
Score PSH - measure-object and csv
Paul McAllister - 1 May 2006 1:44 AM - 8 messages
I am trying to to do the following: read a csv specify a column perform measurements on the values in the column Trying with the following command.  But all I get is the count of rows in the file. ...
Score Batch files and scheduled tasks
Maxwell2006 - 30 Apr 2006 12:15 PM - 3 messages
Hi, I have scheduled task that runs a batch file every 10 minutes. The problem is that whenever the job runs, it shoes an empty black DOS command prompt screen. Is there any way to make scheduled task not to show ...
Score [PSH] get-alias ?
applepwc - 30 Apr 2006 3:18 AM - 8 messages
I konw "?" is a wildcard. But If  I just only want to fetch  "?" alias information through get-alias: CommandType     Name                            Definition ...
Next »