Redirection 1>StdOut.txt 2>StdErr.txt Hi,
I have some tasks that take hours to run. Using WSH I'm able to run the
task in silent mode (scheduled task) sending the output to StdOut.txt
and status messages to StdErr.t | | 0 | 196 | 12/13/2009 11:35:42 AM |
Different results same directory client and server I cannot access files in a specific directory on a server (Windows
2008 R2) which appear to be present in the same directory from the
client's (Windows 7) view. Also, 'get-acl' is returning | | 0 | 125 | 12/13/2009 11:35:42 AM |
Enable script in powershell with GPO By default, PowerShell comes with scripting disabled, I know that I
fix this with the command:
set-executionpolicy unrestricted
But how to set this in AD (GPO) for this comm | | 0 | 148 | 12/13/2009 11:35:40 AM |
gwmi and powershell to get group of computers serial numbers I'm trying to write a simple script to get the serial number of a bunch of
machines. I'm new to writing scripts. Here is what I was trying to do:
$server = Import-Csv C:\Tools\machi | | 0 | 140 | 12/13/2009 11:35:40 AM |
Array Question Part 2 Some of this is extremely new to me. Code below is info I have been piecing
together.
From what I can determine the line below doesn't appear to be
saving/appending my object
< | | 0 | 64 | 11/30/2009 10:44:57 PM |
Convert data to UK date type I have a small script for reading the AV def dates from a file.
$def = (gc "C:\Program Files\Common Files\Symantec
Shared\VirusDefs\usage.dat")[0,2,4] | foreach-object {$_.R | | 0 | 69 | 11/30/2009 10:44:56 PM |
CommonParameters help Hi gents,
root cause of my problem - if you don't have transcript running and you
execute Stop-Transcript, you will get error message saying "The console host
is not curren | | 0 | 36 | 11/30/2009 10:44:55 PM |
WriteObject and Objects owned by Thread In a Cmdlet implementation, WriteObject needs to be called in the same
thread. I need to be able to WriteObject on a object owned by a different
thread, the one which created it.
any | | 0 | 39 | 11/30/2009 10:44:54 PM |
WriteObject and Objects owned by Thread In a Cmdlet implementation, WriteObject needs to be called in the same
thread. I need to be able to WriteObject on a object owned by a different
thread, the one which created it.
any | | 0 | 40 | 11/30/2009 10:44:53 PM |
WriteObject and Objects owned by Thread In a Cmdlet implementation, WriteObject needs to be called in the same
thread. I need to be able to WriteObject on a object owned by a different
thread, the one which created it.
any | | 0 | 36 | 11/30/2009 10:44:53 PM |
WriteObject and Objects owned by Thread In a Cmdlet implementation, WriteObject needs to be called in the same
Thread. I need to be able to WriteObject on a object owned by a different
thread, the one which created it.
any | | 0 | 38 | 11/30/2009 10:44:52 PM |
Is this a know issue? This is a multi-part message in MIME format.
------=_NextPart_000_0006_01CA706E.D4C9AA20
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Hi guys,
Wh | | 0 | 56 | 11/28/2009 1:13:33 PM |
Array question Hello,
I have 7 csv files with various server names in them and I have created an
8th csv file that is a merge of the 7 where all values are unique and the
file has been sorted. What | | 0 | 43 | 11/27/2009 11:19:42 PM |
I'm beginner in powershell.....Neeed your help. Hello,
I wrote my first script in powershell. This script lists all users
in a group on a server. It
seems easy for the specialist but I think my code is not optimized.
Could yo | | 0 | 102 | 11/27/2009 9:30:58 AM |
Powershell still a script ? Does powershell one day allows you to compile the script into exe and remote
administrators can use it ?
Currently whenever i write a script, i have to inform the remote
adminis | | 0 | 75 | 11/27/2009 8:06:53 AM |
launch exe files in ps1 Hi all I wanna to know how can I launch a exe file within a powershell
script, for instances I have this function in a script:
Function edit($file){
$program = 'd:\Program Files | | 0 | 64 | 11/26/2009 5:08:50 PM |
Is it possible to run a Powershell script as a Windows Service? Is it possible to run a Powershell script as a Windows Service?
Many Thanks,
=Adrian=
| | 0 | 48 | 11/26/2009 2:25:48 PM |
Powershell and sysinternals utility PSExec I can't seem to get psexec to execute a powershell on a remote
computer. Is this supposed to work?
Thank you.
Ed Bradford
| | 0 | 51 | 11/25/2009 11:01:17 PM |
Expanding string Hi gents,
my scripts are loading configuration settings from external XML files. My
problem is that I would like to support also variables in it, however it's
automatically save | | 0 | 47 | 11/25/2009 9:14:07 PM |
New 2.0 behavior regarding the PATH environment variable PowerShell 2.0 RTM appears to be prepending its system path to the PATH environment
variable, but it is using a literal macro variable instead of expanding it.
This is the value of my | | 0 | 78 | 11/25/2009 8:55:13 PM |
Is there a simple, free, method to send files using FTP? Is there a simple, free, method to send files using FTP in Powershell?
Many Thanks,
=Adrian=
| | 0 | 78 | 11/25/2009 4:31:14 PM |
GetSummariesPerUpdate method the method
microsoft.updateservices.administration.iupdateserver.getsummariesperupdate
detailed here:
http://msdn.microsoft.com/en-us/library/microsoft.updateservices.administration.iu | | 0 | 48 | 11/25/2009 11:50:41 AM |
How to test Telnet connectivity A) PS2.0 installed on MY XP.
b) i've a list of SERVERS with telnet service turn on.
c) i've only one exchange relay server, let's call it relay_server. Telnet
service is tu | | 0 | 76 | 11/25/2009 8:35:15 AM |
What is Powershell 2.0 BACKGROUND job ? Using xp with ps 2.0. Read the help file on that.
Any simple example background scripts to show so that i appreciate how this
background job works ?
Pls keep it simple.
| | 0 | 101 | 11/25/2009 8:11:13 AM |
Windows PowerShell 2.0 + WinRM 2.0 for XP and Server 2003 Released on October 27th : Windows PowerShell 2.0 + WinRM 2.0 for XP and
Server 2003
Description of the Windows Management Framework on Windows XP, Windows
Server 2003, Window | | 0 | 72 | 11/25/2009 3:24:49 AM |
VB.NET powershell Pipeline.Invoke: pass $NULL as value Hi all,
I need to be able to pass the Powershell $null value as a parameter to a
powershell pipeline invocation:
EG:
Mycomand = new command("set-mailbox")
| | 0 | 89 | 11/24/2009 7:02:18 PM |
List names in registry I have an applciation that tracks the servers it is connected to within the
registry (Trend Server Protect). I need to extract this data but it isn't
as clean as I would like. I currentl | | 0 | 32 | 11/24/2009 4:43:11 PM |
Set-Item and the magic -concatenate argument... Received a powertip email today stating:
Use the -Concatenate switch to add new entries without overwriting existing
entries:
Set-Item WSMan:\localhost\client\trustedhosts
| | 0 | 42 | 11/23/2009 9:18:19 PM |
Exchange 2k7 powershell truncates multi-value properties Greetings,
I'm running the following command:
Get-SendConnector -Identity "Send Connector Name" | ft -autosize -wrap
-property AddressSpaces
We h | | 0 | 44 | 11/23/2009 8:38:18 PM |
Baffled by v2 advanced functions The below advanced function works as I would expect. But if you remove the
line of code that makes the nonsensical access to $MyArrayArgument.Length
then it longer works the same way. Wh | | 0 | 38 | 11/23/2009 8:19:11 PM |
New-PSSession I have trying to setting up remoting between a Windows XP SP3 machine and a
Vista box. I followed on the direction and it seems I am ready to go on the
Vista box. I issue the command New-P | | 0 | 45 | 11/23/2009 5:02:19 PM |
Defining global scoped functions from within a script file I want to have a define.ps1 file that defines a set of functions that
will end up in the function: drive, similar to the $profile file that
runs at startup. The functions are defined in th | | 0 | 62 | 11/22/2009 12:01:19 AM |
Powershell.exe troubles with spaces, quotes, and arguments I need to run a PowerShell script from a command prompt, but am having
trouble. This command works fine inside PowerShell:
Get-WMIObject MSCluster_ResourceGroup -ComputerName MYEXCHA | | 0 | 77 | 11/20/2009 10:03:44 PM |
Finding YYYYMMDD_YYYYMMDD files with regexp Hi,
I have several hundred files here which accidently got renamed after the
following pattern:
YYYYMMDD_YYYYMMDD-something
where the first date does | | 0 | 47 | 11/20/2009 8:24:17 PM |
Windows update Hi all,
I've been combining two of the scripts I have found relating to windows
update services, basically I've come to a stop with passing a target group to
the computer scope | | 0 | 66 | 11/20/2009 10:28:51 AM |
typed variables I just now noticed there is a big difference in coding
$i = [int] 9.99
and
[int] $i = 9.99
PS C:> $i = [int] 9.99
PS C:> $i
10
PS C:> | | 0 | 49 | 11/19/2009 11:36:08 PM |
Script with FileTransfer as scheduled task on Win2008 Hello,
I'm struggling to get a PowerShell script that uses the FileTransfer
module to function correctly when run as a scheduled task on Windows
Server 2008.
Consider | | 0 | 51 | 11/19/2009 3:36:37 PM |
How to get data from performance counters only for one particular process Look at this:
[30]: Get-Process svchost
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- ----- | | 0 | 42 | 11/19/2009 1:03:50 PM |
Invalid performance counter path Hi there, I have some problems when measuring performance of w3wp
process.
I use something like
while(condition) {
Get-Counter -computer c 'asp.net\request wait time',....., | | 0 | 49 | 11/19/2009 12:46:04 PM |
How to clear the Manager attribute for a user supposedly I can use the set-qaduser cmdlt to clear the manager attribute and
not just change it. the following command runs without error but does not
clear the attribute:
set-qadus | | 0 | 49 | 11/18/2009 8:49:39 PM |
Change AD User Password I am not AD admin. Give a user's current password, how to change his/her
password in powershell?
Thanks
| | 0 | 75 | 11/18/2009 8:49:39 PM |
Powershell as a Java Scripting Language Does anyone know if there is an open source project to port PowerShell as a
Java scripting language like Jython, Jruby, and Jperl?
| | 0 | 50 | 11/18/2009 5:15:04 PM |
Background Job Hung I want to use background jobs to manipulate SQL data. I have a PS script
JobName.ps1 as the following:
param([string]$instance, [string]$database)
$destinationConnection = | | 0 | 45 | 11/18/2009 4:59:38 PM |
parse logs with multiple variables
i am trying to parse log files (text files) by searching multiple
variables and i cant seem to tie them all together through regex or
pipelining properly.
here are all the things | | 0 | 44 | 11/18/2009 2:41:52 PM |
I thought Powershell was MTA
I have an application that hosts Powershell and supplies the PSHost.
PSHostUserInterface and PSHostRawUserInterface interfaces and my write
routines are all reentrant and my app is MT | | 0 | 42 | 11/18/2009 2:41:52 PM |
Mount Exchange 2003 databases using Powershell Hi All.
I can use powershell to return a list of Exchange 2003 databases that are
dismounted using the following command...
Get-ExchangeServer | where-object {$_.IsExchange | | 0 | 44 | 11/18/2009 12:55:31 PM |
Set security DACL issues Hi,
I'm trying to debug a script that imports share info to recreate backup
shares, however I've run into a problem with a line of code:
PS H:\> $sd = new-object system. | | 0 | 54 | 11/18/2009 8:57:19 AM |
Slow? I have a set of about 230 files that I want to modify. I use the
following script:
rm tmp.tmp
foreach ($file in dir *exitlc.cfg)
{
echo $file.name
| | 0 | 44 | 11/18/2009 7:14:14 AM |
converting 1.0 snap-ins to 2.0 modules Per the subject line, is this documented anywhere? I did a search on MSDN
and Google and didn't find anything particularly clear. I have some C#
snap-ins that I'd like to convert to 2.0 mo | | 0 | 80 | 11/18/2009 3:17:02 AM |
How do I get absolute path of a file? Hi
I would like to copy a collection of .doc files to C:\ one by one and print
out on screen.
What I am doing is first getting a collection of doc files:
$docs = get- | | 0 | 36 | 11/18/2009 12:58:22 AM |
Configure winRM for all XP workstations in domain? Now that WinRM and PowerShell 2.0 are available for XP I'd like enable all
workstations for remote management.
What is the recommended way to enable WinRM 2.0 and PowerShell for remot | | 0 | 50 | 11/17/2009 9:53:57 PM |
Delete files with a specific string Hello,
I am looking for a way to delete every file that has a specific string in
the filename and i want to delete the files from a folder and all subfolders.
here is what i have come | | 0 | 51 | 11/17/2009 7:56:47 PM |
How to run an app of Guest machine Hi.
I've installed Virtual Server 2005 and also installed XP Guest OS in Host
System(VS2005).
Using 'Invoke-item', it shows up the app in Host Sytem not an guest os.
W | | 0 | 45 | 11/17/2009 3:29:15 AM |
PowerShell in safe mode? Can PowerShell be used in Safe Mode ?
| | 0 | 42 | 11/16/2009 10:52:02 PM |
Reoplace text in multiple word Docs Hi.
I am learning how to use PowerShell.
But now I have a task that I don't know if can be done with PowerShell.
I have to find some text in multiple documents in different directories, | | 0 | 44 | 11/16/2009 10:51:58 PM |
executing a remote "msiexec ..." command should i use powershell ?
that is ping the remote machine, if online, then execute a remote "msiexec
...command to uninstall application"
OR
use group | | 0 | 58 | 11/16/2009 10:51:58 PM |
How to use enum type as function argument I have an object reference in my script that I would like to call a method on
using an enum type as an argument. I can get list the values on the enum just
fine doing this:
$Ale | | 0 | 42 | 11/16/2009 10:51:57 PM |
I thought Powershell was MTA (V2 of PS and V2 of this post) Sorry if this doubles posts but the Windows Vista x64 forum is not working
properly so am posting here directly.
I have an application that hosts Powershell and supplies the PSHost.
| | 0 | 44 | 11/15/2009 8:18:06 PM |
Can my host interrupt a Powershell script?
Is it possible to interrupt a hosted Powershell script? My hosting
application allows hosting a user defined Powershell script which should
run ideally as a never ending timer event ha | | 0 | 47 | 11/14/2009 5:48:14 PM |
Script to import users and created mailboxes in Exchange 2007...er I have a script that i have written that will import users from a csv file
and create the mailboxes. Here is the code:
# Set up variables
$data = Import-CSV c:\import.csv
< | | 0 | 47 | 11/14/2009 5:48:13 PM |
Get Window Position - fun with P/Invoke and pointers This is a multi-part message in MIME format.
------=_NextPart_000_0020_01CA6510.A1F6F940
Content-Type: text/plain;
charset="x-user-defined"
Content-Transfer-Encoding: quoted-printable
Hi all | | 0 | 37 | 11/14/2009 10:18:04 AM |
When less is more The help command is great, but the old DOS more command REALLY sucks;
among other failings, if you go past something, you can't back up.
So, I did some investigating. "more" | | 0 | 48 | 11/14/2009 4:20:07 AM |
set-location to device Will powershell let you set location to a connected phone device?
When I connect a mobile phone it shows up in explorer as
\computer\devicename
I can browse the phone with W | | 0 | 47 | 11/13/2009 4:51:31 PM |
How to deploy powershell? I'm sure this has been asked but nothing came up in search. What is the best
way to deploy powershell out to all of my users on XP and other machines? I
saw the software from specsopsoft b | | 0 | 56 | 11/12/2009 10:21:01 PM |
Help check Mailbox Stores and Mount - Exchange 2003 I want to enumerate our Exchange Mailbox servers, check each mailbox database
and mount if not already mounted.
I can easily enough do this for Exchange 2007 servers, but not Exchang | | 1 | 46 | 11/12/2009 9:24:01 PM |
Relative paths Hi everybody!
I have a script which processes some files and calls some other scripts that
reside in the same directory as the script file, like so:
# MyScript.ps1
| | 1 | 40 | 11/12/2009 9:23:01 PM |
Allowing PS Remoting into my custom desktop PowerShell hosting app
We want to host the PowerShell runtime in our desktop windows application to
give our customers an option to write product extensions and customizations
in PowerShell script. WPK see | | 1 | 51 | 11/12/2009 7:10:04 PM |
can powershell perform event listener ? in pure coding using .net framework, i can write a service that contains
threads to listen.
Can powershell perform the following ?
a) Open a powershell console, start the p | | 3 | 48 | 11/12/2009 5:02:09 PM |
Restart stopped Exchange Services Hi,
I am trying to run a script which retrieves a list of Exchange 2003 Servers.
I then want to check the Exchange related services on each server and restart
them automatically | | 9 | 35 | 11/12/2009 9:24:01 AM |
Prohibit IEnumerable for default output formatting I'm working with an (opaque) Api where classes have 'scalar'
properties and implement IEnumerable at the same time.
In a console host the default formatting is that the Enumerator is
< | | 3 | 48 | 11/12/2009 8:12:09 AM |
Untick 'Do Not Filter Junk Email' option in OWA with Exchange 2007 Hi All,
I do not want outlook clients filtering junk email as they are getting it
wrong with some important stuff.
The actual spam filter running on Exchange is working fine, nev | | 1 | 45 | 11/11/2009 10:23:29 PM |
Adding a group from another domain / forest Hi. Can anyone suggest some code to add a global group from one domain to a
domain local on another?
I've experimented with calling DSMOD etc but I get 'server returned a
refer | | 1 | 55 | 11/11/2009 4:57:13 PM |
Test Cluster Node Given a computer name, how to test it if it a cluster node or not? without
calling WMI MSCluster with $null return? Are there any classes with a
property of IsClustered?
Thanks, | | 6 | 67 | 11/11/2009 4:16:01 PM |
Set-ItemProperty error when trying to modify AppPool Recycling set I have a script to modify Application Pool recycling settings. Modifying int
data type objects works fine, but changing TimeSpan objects causes error when
trying to write back changes with | | 3 | 42 | 11/11/2009 3:59:44 PM |
how do i determine the OU structure on the fly ? Each time i script, i have to hard-code the OU. Is there a method to
determine the AD OU structure on the fly ?
Let me give a scenario:
# generic way to determine ANY ORGAN | | 7 | 49 | 11/11/2009 3:36:40 PM |
Problem installing PowerShell 2.0 on W2003SP2 x64 I=B4m running Windows 2003 Ent.Server SP2 x64 ENG and get an error when
installing PowerShell2.0 (=3DWin Mgmt Corepack x64 ENG)
"... is not a valid W32 Application"
| | 1 | 82 | 11/11/2009 1:20:27 PM |
Powershell on Windows Server 2003 x64? All my servers are 64 bit. Is there a 64 bit version of Powershell? All my attempts to install are failing that it won't install to 64 bit.
Thx, Don
| | 7 | 51 | 11/11/2009 9:18:00 AM |
Is there an available ps 2.0 for XP x64 I'd like to install powershell 2.0 on my machine(XP x64), i only find
powershell 2.0 for XP x86, is there an available powershell 2.0 for XP x64?
or Can i install for server2003 x64 to ins | | 3 | 86 | 11/11/2009 3:31:12 AM |
the Windows registry It seems that some strategies of writing code using PowerShell involve
manipulating the Windows registry (and PowerShell makes that so easy!).
What I'm wondering is how portable these | | 2 | 45 | 11/10/2009 3:55:29 PM |
using PowerShell to manage file associations How can I use PowerShell to manage Windows file associations that specify a
program to handle an action for a file, depending upon the file extension
portion of the filename?
| | 4 | 40 | 11/10/2009 3:35:16 PM |
Control-U equivalent? Is there a PowerShell equivalent to the ksh Control-U editing command?
That is, is there a keystroke that clears the current command line?
| | 4 | 45 | 11/10/2009 1:11:40 PM |
T Find<T>() Hi,
I'm trying to convert some C# code into powershell and have come across the
following syntax that I don't know how to convert.
T Find<T>()
http://msdn. | | 4 | 52 | 11/10/2009 11:11:12 AM |
simple -replace question Why does
"one" -replace ".*", "two"
return
"twotwo"
?
WHere is the replace operator fully documented? All I can find is t | | 22 | 59 | 11/9/2009 10:14:03 PM |
Powershell: Script to retrieve path of file given the filename on a remote unix server Hi All, (Powershell n00b here!)
I need to write a script which can run on windows (hence considering Powershell) which can log into a remote unix server and retrieve full path of file given the f | | 6 | 51 | 11/8/2009 11:27:26 PM |
Computer Rename using Win32_Baseboard Serial number Hey All,
I am new to powershell and I am trying to rename my Windows 7 laptop using
powershell. I have the following script and it's not working. Does anyone
know where I am goi | | 6 | 86 | 11/8/2009 8:59:54 PM |
Want to use remove-item but save names to log file of files delete So I want to search a directory, locate all files except those in the exclude
statement, and then remove them.
HOWEVER, I want to write a list of the files removed to a log file. (th | | 10 | 35 | 11/8/2009 7:48:02 PM |
How to retrieve the script name inside Powershell?
$args contains the passing arguements, but no script name. How to get the
script name inside itself in Powershell?
Thanks!
| | 5 | 47 | 11/8/2009 5:11:33 PM |
How to get WMI embedded array? Hi folks,
I'm trying to convert the below VBScript to PowerShell. I always come up
with a null array when trying to enumerate the AssignedSchedules with
PowerShell but with VBS | | 3 | 48 | 11/8/2009 1:48:23 PM |
Standard Cmdlet Verbs - 'Manage'? Hi all,
I have a script that, for reasons of coherence, does Enable, Disable, Stop, Start and Set functions. Primary reason is that there's shared functions and I do not want to hav | | 4 | 52 | 11/8/2009 6:10:24 AM |
seeing all job titles and memberof groups for all user in particular OU As my subject states, this is what I'm trying to do. I can get the script to work for it to just show the job title but I'm trying to also have it list the memberof groups for each job title a | | 1 | 42 | 11/7/2009 10:49:01 PM |
Status Reports Hi Gurus;
I need a text file to record what process ran with what filename at what
time. My aim is to get a log so that it can help us write our status reports,
because it takes so fr | | 2 | 51 | 11/7/2009 1:09:01 AM |
Using powershell on a shared system Anyone have any experience with Using powershell on a shared system?
How do you set up individuale profiles?
And is there a way to set it up so that you don't get asked if it's OK
to ru | | 3 | 52 | 11/6/2009 10:25:05 PM |
Write-Host buffer error? Hi gents,
Colleague of mine sent me small piece of code that was failing today.
Problem was that Write-Host returned error when string was too long. I
already run into that proble | | 2 | 48 | 11/6/2009 3:53:29 PM |
writing output to log file from gwmi I'm trying to output the results from the following powershell script to a
log file:
$strComputer = Read-Host "Enter Machine name"
$strDate = Get-Date -Format M.d.yyyy
| | 6 | 32 | 11/6/2009 1:16:01 PM |
out-gridview in ver 2 I dig out-gridview, but the former 10 column limit was the reason I
didn't use it so much.
MS said this limit was to be lifted in ver 2, but it seems they just
increased it max 30 colum | | 1 | 52 | 11/6/2009 12:28:34 PM |
PowerShell for the home user I'm trying to put together a presentation oriented around PowerShell as it
relates to the home user.
I know this goes against the grain of what PowerShell is primarily designed for,
| | 7 | 53 | 11/6/2009 9:47:47 AM |
Properties of the get-eventlog cmdlet? Hi,
I'd like to find the methods and properties of the get-eventlog
cmdlet. But when I try "get-member | get-eventlog" it does not do what
I expect it to. Is there some | | 4 | 50 | 11/6/2009 6:37:09 AM |
POWERSHELL 1.0 NOT COMPATABLE WITH XP Windows XP professional conflicts with Powershell 1.0. Does anyone have patch or can you tell me how to uninstall Powershell. Powershell is not identifiable in the add and remove programs | | 2 | 90 | 11/6/2009 5:17:34 AM |
Get-Content issue with formatting I have a script which I run as follows.
Powershell -command "& {C:\MyScript.ps1 | out-file x:\Results.txt}"
The output in the file looks as follows...
== | | 10 | 43 | 11/5/2009 5:03:18 PM |
Test for parameters in functions param($p1, $p2, $p3, $p4)
function Usage {
@'
Syntax: powershell.exe .\testhello.ps1 p1 p2 p3 p4
-parameter p1, p2, p3, p4 are mandatory
'@
exit 1
}
# tes | | 11 | 57 | 11/5/2009 9:49:23 AM |