Group:  English: General ยป microsoft.public.windows.powershell

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Threads Replies Last Post
22 Pages: 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  
accessing properties with foreach-object versus format-table
Should there be any difference in these two statements, performance- wise? The second one is easier to read, IMO, and I'd like to know if there are cases where I would not want to use it. # Get-WMIObject Win32_Printer | foreach-object{$_.Name} # Get-WMIObject Win32_Printer | format-table name ...
2 09.07.2007 16:06:42
list of printers...
Hi there, one more question : how could i list all the printer queues that are located on a specific server ? ex : \\printerserver\HPcolorXXXX ? bye Nico ...
5 09.07.2007 14:54:42
trapping error messages froom get-qaduser
i'm currently pulling a list of usernames from a mysql database and storing it within a variable, and using that variable to query AD with get-qaduser. my ultimate goal is if the user exists in the db but not in AD to put that user's info into a file. the problem that i'm having is it appears that get-qaduser is not generating any errors when when it doesn't find a particular user, it just move...
4 09.07.2007 14:30:35
Webpage scraping
I'm using the following code to scape a webpage, but instead of returning the entire html content of a webpage, it returns the only about half the content with an 'Invalid Data' message appended to the end of it. Any clues as to why this might be happening? function GetWebpage([String]$address) { [System.Net.HttpWebRequest] $request = [System.Net.HttpWebRequest]::Create($address) $...
6 09.07.2007 14:24:54
Parser for LDIF output file
Has anyone seen any cmdlets or parsers in Powershell to object-ify (is that a word) the Active Directory data output in an LDIFDE file? That is a nasty file format with line wrapping and base-64 encoding that I would love to find an easy way to process. Thanks in advance. Steve ...
4 09.07.2007 09:40:01
loop through and array
I have two files. One with a list of users. One with 3 servers. I need to read each user and assign one server per user. How do I loop through the 3 servers? Like, user1 - server1 user2 - server2 user3 - server3 user4 - server1 .......
9 09.07.2007 05:06:00
Reading and Writing to DVD-RW, CD-RW
What do I need to copy files from a hard drive to a CD Drive. Suppose the CD is loaded with a CD-RW. Do I need a UDF driver like INCD or is there a PowerShell provider that does the same. I would like to manipulate the 'items' on my CD-RW just as I would on my hard drive. This has alwasy been a mystery to me. I am running WinXP. I realize in WinXP you can batch files to your CD-RW by...
2 08.07.2007 23:26:03
Unix Cal command in PoSh
While I was browsing the web today I came across this screenshot of a command prompt on a Unix computer. http://cache.lifehacker.com/assets/resources/2007/07/Term.png The first thing I noticed was the calendar that was displayed for the user. Some Googling showed me that Cal is a command available in Unix that displays a read-only calendar on the command line. I'm wondering if an...
7 08.07.2007 19:53:16
Curious DIR error
Here's a command and the resulting error: PS s:\> dir -path "c:\" -Exclude "autoexec.bat" Get-ChildItem : Cannot process argument because the value of argument "path" is invalid. Change the value of the "path" argument and run the operation again. At line:1 char:4 + dir <<<< -path "c:\" -Exclude "autoexec.bat" Curious... why does this particular error occur? It's almost...
4 08.07.2007 16:44:01
Return of object with synthetic members from functions
Hi I have been unable to return objects with the synthetic members preserved from functions. The example below illustrates this. ---------- Example starts here ---------- function New-SyntheticObject { $obj = @( 'a', 'b' ); $obj = Add-Member -passThru -inputObject $obj ScriptProperty 'A' { $this[0] }; $obj = Add-Member -passThru -inputObject $obj ScriptProperty 'B' { $thi...
6 08.07.2007 00:26:59
$_.contains versus -contains
$_.contains versus -contains... Should these behave differently? 175# $test=@" >> test 123 >> "@ >> 176# $test -contains 123 False 177# $test -contains "123" False 178# $test|foreach-object{$_.contains("123")} True 179# $test -contains "test 123" True (I seem to remember that I think it was also different behaviour between $_.replace and -replace.) Mar...
3 07.07.2007 16:55:07
Compare 2 files with 6,000 entries each
I've got one text file, and one csv file. As per a previous thread, I wasn't able to figure out how to use compare-object to get all the matches from each file (Keith pointed out that I'd need -synchWindow to compare > 100 lines, but I haven't tried it yet). The only way I've found to match up each file is to load each file: $txt=get-content users.txt $csv=import-csv users.csv ...
6 07.07.2007 02:08:21
Comparing files with compare-object
I've done everything I can think of to properly format a string to compare between 2 files. I've confirmed to my best of knowledge that one particular entry is *exactly* the same in two files (same lenght, etc). However, I cannot seem to get compare-object to find a match. 76# import-csv file1.csv|%{$_.'SN,CN'}|%{$_.replace(' (+)','')}|%{if($_ -match "some_user_removed"){$_}}|%{$_.l...
5 06.07.2007 16:21:48
Pipeline stop-service with -force
The following works fine if the -force switch is not used, but fails with the -force switch. I suspect that I need to place the service name parameter between the stop-service and the -force but I can't ascertain the syntax? get-service | where { $_.status -eq "running" -and $_.name -eq "MyService"} | stop-service -force Regards Julian ...
13 06.07.2007 12:30:00
equivalent to vbscript "."
for local machine, vbscript uses "." to represent local machine. How about powershell ? ...
3 06.07.2007 12:01:54
get-item env:
how can i get the environment on a remote machine ? ...
2 06.07.2007 11:43:52
running .ps1 script at commnd prompt
i've created a powershell script, eg test.ps1 I saved this script in d:\scripts\ subfolder. When i m at cmd prompt d:\scripts\, i type the command : =================================== d:\scripts\powershell.exe test.ps1 (does not work) d:\scripts\.\test.ps1 (does not work either) d:\scripts\powershell d:\scripts\test.ps1 (works) =================================== Why 1st two c...
3 06.07.2007 08:32:01
array
this works great -------------------------------------------- function Get-RandomElement($Array) { $Array[ $Random.Next( $Array.Count ) ] } $test="1", "2", "3", "4", "5", "6" $Random=New-Object Random $Message = Get-RandomElement $test $Message -------------------------------------------- but, if I change this line: $test="1", "2", "3", "4", "5", "6" and put this line: $test = Re...
8 06.07.2007 08:07:38
Enumerating group membership & ADSI
Hi, Can anyone tell me how to enumerate the members of an AD group using Powershell? It seems that the ADSI features are still quite limited so I'm wondering if there is a quick way to do this. Thanks in advance. CrazyKiwi...
8 06.07.2007 00:42:01
RFC: Powershell Information Central
Im trying to keep it up to date... If you guys see anything I am missing please let me know.. Specifically any links or and Blog I may not be searching in my Google Engine. Thanks in advance. http://bsonposh.com/modules/wordpress/?page_id=13 -- Brandon Shell --------------- Stop by my blog some time :) Blog: http://www.bsonposh.com/ PSH Scripts Project: www.codeplex.com/psobject ...
22 06.07.2007 00:37:08
Enumerating local group membership with Powershell
Hello, I'm having trouble enumerating local group membership with Powershell. I've found several VBScript examples, but they never seem to work when I port them to Powershell. Here's my starting code: $strSrv=[System.Environment]::MachineName $strGrp= "Administrators" $objSrv = New-Object System.DirectoryServices.DirectoryEntry("WinNT://" + $strSrv + "/Administrators,group") $members...
5 06.07.2007 00:16:00
invoke PS scripts from a web page
Hi, Is it possible to invoke PS scripts from a web page? I can see this functionality being useful as I create more administration scripts? Thanks, ...
2 06.07.2007 00:03:14
PoSh on Windows Home Server?
Are there any plans to support PowerShell on Windows Home Server? No really, you can tell me, I won't tell anyone else! :) -- greetings dreeschkind...
6 05.07.2007 21:40:01
multidimensional array initialization
Hi, I would like to initialize a 3 dimensional array. I understand this could be used: $array = new-object 'object[,,]' 50,50,50 Can someone tell me what the 3 parameters are? Thanks, ...
2 05.07.2007 20:20:03
Is there an equivalent to /dev/null
Is there an equivalent to /dev/null (like Unix) for redirecting the output of a command in PowerShell?...
7 05.07.2007 19:05:27
22 Pages: 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net