|
add users to groups of a remote computer
Hello, i belong to IT of a big corporation, and i would like to be able to
add some users to "Administrators" or others local groups of a specific
machine, by powershell script.
How to do that ?
bye
Nico
...
|
7 |
07.06.2007 15:29:30 |
|
PowerShell and Perl interoperability
Hello,
I'm in the process of executing and Exchange 2007 migration. The
organization currently uses a Perl-based web page (running on a Unix
host) to manage a lot of the onboarding and administrative tasks (a
lot more than just email). I'd like to replace the current module
they're using in Perl to manage email with one that will use
PowerShell, since Exchange 2007 is so PowerShell-capable...
|
5 |
07.06.2007 16:52:56 |
|
Powershell script files
I'm having problems understanding how Powershell deals with script
inside a .ps1 file. It appears there are at least 3 "script blocks"
(begin, process and end) but the use of these isn't clear. It would
also seem desirable to use a function or method in a pipeline (or maybe
locally defined cmdlets). I have been able to use functions in a
procedural manner but it's not obvious how to exte...
|
2 |
07.06.2007 15:20:51 |
|
TechEd 2006 Barcelona video with myspace.com
Seems to me there was an online video from TechEd last year (the week
PowerShell was releasted) done perhaps by Jeffrey Snover and someone
from myspace.com. Myspace talked about how they are using PowerShell.
I never did get to watch the video, but now want to.
Can anyone find it?
Marco...
|
1 |
07.06.2007 13:34:52 |
|
Using .reg file syntax
I've got a .reg file that looks like this:
------------
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\xxxx]
@="xxx-WEB-TRIAL"
"xxx"="xxx-yyy-zzz"
"xxx"=""
------------
Our IT had disabled all regedit tools, so I'm left with having to go in
with PowerShell.
I've not been able to interpret the above syntax to use it within
PowerShell.
Anyone have any ideas?
Marco...
|
6 |
06.06.2007 22:54:20 |
|
Powershell and WMI: 802.11
Trying to get a list of active access points from the wireless card. The
following:
gwmi -name "root/wmi" MSNDis_80211_BSSIList | % {$_.Ndis80211BSSIList}
doesn't list a set of 'BSSIList object, but rather the obscure
'format-default : Exception retrieving members: "Not found "'
I'm guessing that my powershell just doesn't know how to deal with whatever
WMI is returning. It looks l...
|
5 |
06.06.2007 21:31:03 |
|
PowerPad
Here is an app I posted for the psh community. PowerPad is a quick way to
get multi-line edit from the cmd line when you just want to edit a function,
script, or block quick and run it and return to console.
http://powerlocker.com
Hope it finds a spot in your toolbox.
--
William Stacey [C# MVP]
...
|
23 |
06.06.2007 20:15:34 |
|
How to setup variable for directory execution
Hi,
I have a script which drives many other scripts. Depending on which host
I'm in, the scripts can be in different drives or directories. I typically
have a variable setup, ie,
$dir = "c:\scripts"
Then when I try to execute a script, I would like to do:
$dir\test.ps1
but I get an error:
[C:\scripts]: $dir\test.ps1
Unexpected token '\test.ps1' in expression or statement.
...
|
7 |
06.06.2007 17:47:20 |
|
OnExit handler for PowerShell Console
Is there a way to have a function or a command be executed when the
PowerShell console exits?
...
|
2 |
06.06.2007 17:42:43 |
|
New-object preventing process from exiting
We have a C++ application that has an automation object model.
In PowerShell we create a new instance of the object model via New-Object.
Everything works as expected in terms of calls to the created object.
Problems arise if the user closes the application first, then closes
PowerShell. The process of the application will not have exited, as seen by
Task Manager.
If PowerShell is e...
|
1 |
06.06.2007 17:25:00 |
|
sorting question
Hello:
I'm new to powershell, but am finding it to be pretty great. However,
I'm having some problems with the sort command. Can anyone clue me in
to why the differencing between the following to calls to the sort
cmdlet?
PS> @(3,1,2)|sort
1
2
3
PS> $pmb=@(3,1,2)
PS> sort -i $pmb
3
1
2
Why would the first work but not the second?
Thanks.
pmb
...
|
13 |
06.06.2007 05:12:17 |
|
Does tee-object work?
When I run the following:
"get-childitem | tee-object -variable $x | where-object {$_.length -gt
30}"
I get the following error:
"Tee-Object : Cannot bind argument to parameter 'Variable' because it
is null."
And no amount of playing around with $x or its contents tricks it into
getting a copy of objects emitted by get-childitem.
Am I doing something wrong? Does t...
|
4 |
06.06.2007 00:50:34 |
|
vs shell 2008
hmmm. Now this will be cool for a script language I know of...
http://msdn2.microsoft.com/en-us/vstudio/bb510103.aspx
--
William Stacey [C# MVP]
...
|
2 |
05.06.2007 20:47:02 |
|
Get-ChildItem -include leaks memory
Hi,
Running
PS> gci -R -include *.bat | %{ add-content text.txt $_.FULLNAME}
on a large directory structure (hundred thousand files) ends with an out of
memory exception.
I have included a procexp image of cpu/memory/io.
Running the same command with -filter instead of -include shows no such
increase of memory.
PS> gci -R -filter *.bat | %{ add-content text.txt $_.FULLN...
|
9 |
05.06.2007 20:27:57 |
|
General profile
Hi,
Is there a profile that everyone executes besides their own? similiar to
/etc/profile I would like new users to have specific functions and variables
setup.
Thanks,
...
|
4 |
05.06.2007 19:22:03 |
|
Sorting an array on pattern?
Hi,
Given a textfile (read into an array) with some entries including a
date and some don't. I want to sort this array with date-entries first
(newest dates first) and then the rest of the entries sorted normally
(by content)
The date is identified by "d:"
E.g.
text in line
some text here d:2007-05-04
some text here d:2007-06-01
more text
even more text
some text here d:2007-05-24
...
|
4 |
05.06.2007 18:09:09 |
|
Signing Powershell Scripts with Microsoft Certificate Authority
I'd like to sign my Powershell scripts and we have a Microsoft Certificate
Authority root server in our AD domain. Doesn't this mean that all domain
systems have the root certificate automatically installed on them?
That said, I'd like to sign my scripts, somehow, with this script. Most of
the information on certs for Powershell code focus on the steps for a
self-created cert. I'm havin...
|
7 |
05.06.2007 16:24:04 |
|
Bugs when paths contain apostrophe
The MyDocuments folder on my workstation is set to "C:\Stefan's Documents".
My Powershell command prompt shortcut is configured to start in this folder
(i.e. the "Start In" property of the shortcut). Whenever I start a
Powershell command prompt I get the following error:
<Snip>
Copyright (C) 2006 Microsoft Corporation. All rights reserved.
Incomplete string token.
At line:1 char:2...
|
2 |
05.06.2007 13:51:45 |
|
Execute PowerShell Scripts via http url requests
Is there a way to execute PowerShells commands/scripts via http url
requests?
An example would be something like: http://127.0.0.1:8080/ps?command=$pshome
which would return: C:\WINDOWS\system32\WindowsPowerShell\v1.0
Thanks!
...
|
10 |
05.06.2007 10:50:19 |
|
Interesting bug (?) using PowerShell, Netsh and Longhorn
Came across a fascinating issue today, trying to write some ps1 scripts
to set IP addresses within my testing/demo Longhorn VMs. With 2k3/XP I
just use netshell scripts. Then I hit a weird issue - some netsh
commands do not seem to work from within a powershell script. Let me
demonstrate with some snippets:
Here is the test-bug.ps1 script:
----
# test-bug.ps1 - test of weird longhorn ...
|
7 |
04.06.2007 21:16:22 |
|
change display resolution
Is there a way to change the display resolution on a VISTA PC using
powershell?
...
|
7 |
04.06.2007 18:42:19 |
|
Basic PowerShell Question
Hi,
I have just started looking into PowerShell, and how does one get starated?
I have an XP based machine and VS 2005.
What do I need to start learning PowerShell?
Thanks
Jeff...
|
5 |
04.06.2007 14:49:02 |
|
need to wait for command execution
Hi,
I have a need to wait for completion of a statement before one. ie.
invoke-expression "notepad test.txt"
get-content test.txt
What happens is, as I edit the test.txt file, the script is already done
executing so I get a blank file. Is there a way to wait?
Thanks,
...
|
2 |
03.06.2007 19:59:34 |
|
chm powershell help ?
Hi everybody; do you know where i could find any powershell doc in chm
format (-> not in the pdf format ) ?
thx
Nico
...
|
10 |
03.06.2007 17:59:36 |
|
Using a WMI ManagementScope forces an *async* connection with ManagementEventWatcher?
Hello:
When you connect to a remote computer with WMI by specifying a
ManagementScope, does it force the connection to become asynchronous? The
following code never gets past $EventWatcher.WaitForNextEvent(). It's my
understanding that PowerShell doesn't yet have built-in support for async
WMI, but nothing in the SDK that I could find indicates that the following
forces the connecti...
|
3 |
03.06.2007 03:32:09 |