Reply To: Exchange Powershell -asjob
I suspect that the best way to do it is to install the Exchange admin tools on your local machine. Each job will have to install the Exchange snapin (jobs run in a separate PowerShell process) and run...
View ArticleReply To: Exchange Powershell -asjob
thanks. If you have time to post a quick example would be very helpful.All i’m trying to do is have each mailbox server get the mailboxes and their sizes (in parallel) than my computer doing all the...
View ArticleReply To: Start Automatic Services on Remote machines if stopped
Hi Richard,Though I understood that you are asking me to use “StartService” Method, which I can get when I pipe “Get-WmiObject Win32_Service” to Get-Member, but am unable to figure out how to do...
View ArticleReply To: What am I doing wrong?
% is an alias for ForEach-Object. I haven’t used these IIS-related commands before, but you may not need ForEach-Object at all. Try this (both in remoting and locally): gci IIS:\apppools |...
View ArticleReply To: What am I doing wrong?
Interesting, removing “%,Foreach-object” does work in both cases (remotely and on console). Wondering what is going on in background. So powershell when piping any collection to another cmdlet...
View ArticleReply To: Start Automatic Services on Remote machines if stopped
Give this a try: Get-WmiObject win32_service -Filter "startmode = 'auto' and state != 'running'" -computername (Get-Content C:\ServerList.txt) | ForEach-Object { $result = $_.StartService() # You can...
View Articleparameter: how to require either one or the other but not both
So I’m making my first cmdlet and I’m using the chance to rewrite an old vbscript and improve it. I want to require either a username, or an employeeid parameter. I can’t find the syntax for making...
View ArticleReply To: What am I doing wrong?
You really only need ForEach-Object if you’re doing something more complex, or if the command you want to pipe input to does not support pipeline input. Restart-WebAppPool does support piping the -Name...
View ArticleReply To: parameter: how to require either one or the other but not both
You can do this using parameter sets. By putting each parameter in one set and not the other, PowerShell will take care of the rest. You may want to define a default parameter set, as well: function...
View ArticleReply To: Start Automatic Services on Remote machines if stopped
Brilliant One Dave! Thank You very much! It really made the one liner script work, but now I have a new problem….After doing the one-liner script, though it started the services on remote computers,...
View ArticleReply To: parameter: how to require either one or the other but not both
Awesome, thanks for the quick answer. After watching both the MVA’s on powershell, I’m really enjoying how much you can do with it. It’s much better than vbscript.
View ArticleReply To: Start Automatic Services on Remote machines if stopped
Here’s a fairly straightforward way of outputting the errors if the StartService method failed. It doesn’t take any action, just displays the error on screen. The WMI methods return Win32 error codes,...
View ArticleReply To: Start Automatic Services on Remote machines if stopped
In addition to that, another query is “Start-Service” doesn’t mention anywhere that it doesn’t work on remote computers and only works on local server….. have gone through the “Get-Help Start-Service...
View ArticleHelp with get-adpermission, exporting extended rights to CSV
I am a pretty competent VB/VBscript developer but I swear I am never going to get the hang of Powershell. I run into so many little hang ups for reasons I cannot understand. It is so frustrating.I’m...
View ArticleReply To: Start Automatic Services on Remote machines if stopped
I’ll test this when I’m at home tonight, but I suspect that you actually can use Start-Service on remote computers. You’d just need to pipe it objects obtained from Get-Service, not from...
View ArticleReply To: Start Automatic Services on Remote machines if stopped
But isn’t it correct that …. to get details about “Automatic” services, we have to use “WMI-Object”, as Get-Service can only provide “Name” , “Status” & “DisplayName” properties for a service, but...
View ArticleReply To: Help with get-adpermission, exporting extended rights to CSV
Your main problem is that the CSV file is basically a flat structure, but the security objects aren’t flat at all. The Get-ADPermission cmdlet returns objects of type ADAcePresentationObject. The...
View ArticleReply To: Start Automatic Services on Remote machines if stopped
I hadn’t realized that before, but it looks like you’re right. The .NET ServiceController class (which is what Get-Service and Start-Service use) doesn’t provide any information about the startup type...
View ArticleReply To: Start Automatic Services on Remote machines if stopped
Sure… will do that… Thank You Again!
View ArticleMultiple scripts execution in ISE
Is it possible to execute multiple scripts in PowerShell ISE? I’m unable to run a new script, while another is running. I open multiple PowerShell instances to achieve this. Is there an easier way to...
View Article