header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Search
Search Area
Criteria Options
Search Topics From
Search By User
Search in Forum(s)
Included Forums: ALL
Topic
RE: Query an iOS device name
Interesting problem. I haven't researched this exhaustively or anything, but I'm gonna give an educated guess that you won't be able to find out the device name without the involvement of an agent/client app running on each device. There's several c ...
by halr9000 in General PowerShell on 11 Jan 2012 09:55 AM
RE: Commands fail with TaskScheduler
Have you tried checking the "run with highest" box?
by halr9000 in General PowerShell on 19 Sep 2011 02:15 PM
RE: Web Service Method
You use parentheses to call a method and supply it with parameters. Joel Bennett wrote about it on this blog article: http://huddledmasses.org/parenthesis-in-powershell/
by halr9000 in General PowerShell on 16 Aug 2011 06:39 AM
RE: Web Service Method
The same way you would invoke any other method! $c = New-WebServiceProxy -Uri 'http://www.w3schools.com/webservices/tempconvert.asmx' $c.FahrenheitToCelsius( 72 )
by halr9000 in General PowerShell on 16 Aug 2011 05:33 AM
RE: Remove first line in .csv file
Use the -NoTypeInformation parameter with export-csv.
by halr9000 in General PowerShell on 11 Aug 2011 09:55 AM
RE: The DotNetTypes Provider
That's a strange interpretation, Marco. :) I never implied that Microsoft would be looking into this. On the contrary, I would expect that something like this would come from the community first.
by halr9000 in Working with .NET on 11 Jul 2011 04:49 AM
RE: The DotNetTypes Provider
Interesting idea. I passed it on to a few people. Maybe it'll be interesting to someone who can actually program. :)
by halr9000 in Working with .NET on 10 Jul 2011 06:27 PM
RE: awk equivalent
A few comments. First, WMI queries like this can take a while. It's usually more efficient to perform more specific WMI query, so moving your "*555555*" filter to the Get-WMIObject cmdlet. You can read more about WMI & PowerShell here. Second, th ...
by halr9000 in General PowerShell on 07 Jul 2011 08:18 AM
RE: Stop service on a different computer
And another one from Kirk Munro, this one is a variant on the first WMI solution: Get-WmiObject -Class Win32_Service -Filter 'name="wuauserv"' -ComputerName RemoteComputerName | Invoke-WmiMethod -Name StopService
by halr9000 in General PowerShell on 07 Jul 2011 06:06 AM
RE: Stop service on a different computer
Brand new PowerShell MVP Yuriy Lebedev gave this solution which works great if you have PowerShell remoting enabled in your organization: Invoke-Command -ComputerName Computer123 -ScriptBlock 'Stop-Service -Name eventlog'
by halr9000 in General PowerShell on 06 Jul 2011 07:40 PM
RE: List Unattached Databases SQL - using powershell
To your second question, one way to do this is to put both sets in an object. First of all, this means don't write to CSV during the script unless you need it for reference later. That's a waste of disk space. Do the work in memory, and write out to ...
by halr9000 in General PowerShell on 01 Jul 2011 05:00 AM
RE: List Unattached Databases SQL - using powershell
You can remove occurrences of text in a line by looping through each line and using the replace operator with an empty second parameter. In other words, "replace with nothing". e.g. $a = 'stuff one', 'stuff two', 'stuff three' $a | foreach-ob ...
by halr9000 in General PowerShell on 01 Jul 2011 04:51 AM
RE: 'System.OutOfMemoryException' was thrown
Here are some just general tips. Try these and see how it improves the memory usage. 1. Don't do += here. It's totally unnecessary. In this case, it won't impact memory because we're talking about a short array of strings, but it really can becau ...
by halr9000 in General PowerShell on 21 Jun 2011 06:18 AM
RE: 'System.OutOfMemoryException' was thrown
I can suggest several improvements to how this script is written, but before I do, let me ask this: how many VMs do you have in each vCenter? The error you are seeing has a rather obvious cause. The process hit a memory limit. Why don't you run the ...
by halr9000 in General PowerShell on 20 Jun 2011 05:23 PM
RE: Give me getopts or give me frustration
Check out splatting (a powershell v2 feature). Splatting takes a hashtable and applies the keys as parameter names and their values as parameter values. You supply it in one go like so: $foo = @{ Name = 'value1' Color = 'blue' Number = 4 ...
by halr9000 in General PowerShell on 16 Jun 2011 05:39 AM
RE: Give me getopts or give me frustration
I suggest you check out the "about_functions" help document. It describes several of the options available for accepting parameters as input. You have positional (frankly rare with PowerShell), named, switches, and more. At a prompt, type "help abou ...
by halr9000 in General PowerShell on 12 Jun 2011 10:34 AM
RE: Code behavior
Yeah, we may need you to post that one again...
by halr9000 in General PowerShell on 23 May 2011 03:27 PM
RE: Register scripts file
The Get-VM cmdlet does not come with PowerShell. It's only shipped as a part of a "snap-in" that is an extension of PowerShell's functionality. This snap-in ships with System Center Virtual Machine Manager. If you use the SCVMM console shortcut in y ...
by halr9000 in General PowerShell on 09 May 2011 06:48 AM
RE: Formatting issues while exporting to Excel within Powershell
Guys, it's good manners to create a new thread when you have a new topic rather than to add things onto an existing thread. This helps a lot when others come along later to find information.
by halr9000 in General PowerShell on 22 Apr 2011 05:50 AM
RE: Formatting issues while exporting to Excel within Powershell
You installed the right version. Microsoft will be using the ps1 file extension and the v1 path until or if they decide to break backwards comparability.
by halr9000 in General PowerShell on 22 Apr 2011 05:07 AM
RE: Formatting issues while exporting to Excel within Powershell
@alihassanmunawar you need to get rid of that, v2 final has been out for quite some time now.
by halr9000 in General PowerShell on 22 Apr 2011 04:18 AM
RE: Has someone hacked this site?
It's spam. Nothing to get worked up over. We are on it, and we always try to configure the site to block it. This is nothing new, every forum and blog on the 'net has to deal with this.
by halr9000 in Community Announcements and Assistance on 22 Apr 2011 04:16 AM
RE: Formatting issues while exporting to Excel within Powershell
Again, I haven't looked at the original script due to time, but what you guys are seeing is "as designed". You don't ever want to put Format-Table in a pipeline. The purpose of this cmdlet is to alter the appearance of text strictly to be output in ...
by halr9000 in General PowerShell on 21 Apr 2011 08:42 AM
RE: Formatting issues while exporting to Excel within Powershell
The calculated properties feature had a wierd quirk in powershell v1. Even though the two cmdlets supported the ability to create properties on the fly, the format-table cmdlet used the "label" keyword, and select-object used the "name" keyword. The ...
by halr9000 in General PowerShell on 21 Apr 2011 06:57 AM
RE: Pre-staging computer account in AD
Have you played with the Quest AD cmdlets (http://www.quest.com/powershell/activeroles-server.aspx) yet? To do this with their stuff you would use two cmdlets: Connect-QAdService (and you can specify alternate creds), and the New-QAdComputer to crea ...
by halr9000 in Active Directory on 19 Apr 2011 10:33 AM
RE: What is this funky syntax?
I recommend checking out the PowerShell Cookbook 2nd Ed. from O'Reilly. Treasure trove of examples.
by halr9000 in Working with .NET on 18 Apr 2011 06:37 AM
RE: Issue with Mass Junk Email Filter Enabling on EX2007SP3
Guys, confirmed the issue with the attachment. I'll research. In the meantime, I encourage you to use http://poshcode.org.
by halr9000 in Exchange Server on 10 Mar 2011 10:19 AM
RE: File Copy From Unix (SCO)
If you install Samba on your unix box, then you will be able to create shares and access them using standard UNC paths as you are trying to do.
by halr9000 in Non-Microsoft Products on 17 Feb 2011 06:45 AM
RE: What is a Colon in a varable mean/do?
That allows you to modify the scope of a variable. Reading material to learn more: http://blogs.msdn.com/b/powershell/archive/2007/04/14/controlling-the-scope-of-variables.aspx http://technet.microsoft.com/en-us/library/dd315289.aspx HTH
by halr9000 in General PowerShell on 02 Feb 2011 11:12 AM
RE: PS equivalent of net use??
Some more notes: - "net use" still works in PowerShell - Unfortunately, new-psdrive does not support alternate credentials - You can use UNC paths EVERYWHERE in PowerShell, unlike cmd. Try "cd \\server\share" sometime, works fine. - Look at the ...
by halr9000 in General PowerShell on 12 Jan 2011 09:25 AM
Page 1 of 1912345 > >>
Active Forums 4.3
right
footer   footer
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
footer   footer