Reply To: Poll: Interactive versus Script
50/50 for me. In the shell to work out logic ad hoc, then in scripts to build commands, then back in the shell to test and work out more ad hoc work, rinse, repeat.
View ArticleReply To: Poll: Interactive versus Script
Mostly scripting, I’d say, but that’s to be expected at my job. We have around 5000 servers (and a bazillion POS devices) in the retail space, and most of the work gets done by pushing out scripts...
View ArticleReply To: Poll: Interactive versus Script
At the moment probably 80:20 scripting to shell. More shell when I’m testing. I don’t view PowerShell as an either/or activity and in my opinion it is a huge mistake to do so. PowerShell gives us the...
View ArticleReply To: AD GP Script
Eghhh still no luck, I am using powershell 3.0… Getting this message – “cmdlet Get-GPO at command pipeline position 1 Supply values for the following parameters: Guid: ”
View ArticleReply To: AD GP Script
There’s no call to Get-GPO in the code I posted, so you must have changed it. Looks like you’ll need to obtain the GUID for the calls to Get-GPO, though (unless you’re using the -All switch). The...
View ArticleExchange Script running against all, not input
I have the following script that I am having an issue with. When I run it against an input file, it still goes out and tries to work against the entire domain. I’m not sure how to correct it. Any...
View ArticleReply To: Exchange Script running against all, not input
I haven’t worked with the Exchange PowerShell cmdlets before, so I don’t know if all the syntax in this answer will be right. There’s a lot going wrong in the code you posted from a general PowerShell...
View ArticleReply To: Parse IP Address to get the PTR address
Or further simplified, after splitting the array just use a string format or string concantenation… # Now lets split the address into its parts by using the dot (‘.’) $ipAddressParts =...
View ArticleReply To: Invoke-Command to set PSModulePath
Thanks both for answering. And so fast! First, I tried your code, Posthoholic. It leaves me with the same problem as my own, I’m afraid. It is the Machine variable I care mostly about so that further...
View ArticleReply To: Invoke-Command to set PSModulePath
SetX is a good tool. If you decide to try some other options without relying on the external program, here are a couple of ideas: Try setting the value directly in the registry, and see if that works...
View ArticleReply To: Poll: Interactive versus Script
Richard, you crack me up. You are either doing what the psychologists call projecting, or…I don’t know. Anyway, I’m certainly not pigeon-holeing PowerShell to be one or the other. It is and shall...
View ArticleReply To: Exchange Script running against all, not input
We have changed our domain a couple times and merged domains at least once since some of these accounts were created. We are doing a move to a new hybrid setup (including O365) and we need to strip...
View ArticleRemove AD group members from incorrect groups
Oops! We have about 500 receptionists spread across our various external branches. All receptionists are members of the ‘Receptionists’ AD group. Some dimwit (not me!) managed to add about half of the...
View ArticleReply To: Poll: Interactive versus Script
How about C) Use the ISE with Script Pane Maximized and switch back and forth between the script and console panes frequently? In fact, I usually have several concurrent open instances of the ISE in...
View ArticleReply To: Exchange Script running against all, not input
As Dave said, you have a really big problem with this line: Get-Mailbox -Identity $object | Select -Expand EmailAddresses | ft SmtpAddress > c:\temp\datause.csv You are outputting format objects...
View ArticleReply To: Remove AD group members from incorrect groups
There are a couple of ways of doing it, but it would depend on what attributes you have in AD. Try something like this (not tested): #REQUIRES QUEST AD Commandlets # Collect the members of the good...
View ArticleReply To: Filter out users in an OU from get-aduser/Expired AD attrib?
A bit new to PS, just started forcing myself to use about a month ago. Anyway, a few months behind, but maybe this will help you: Search-ADAccount -AccountDisabled -ResultSetSize $null | where...
View ArticleReply To: using wildcards with add-type
thanks Dave and Poshoholic, I think I can use something based on your comments. I can use Get-Child to search the gac ( c:\windows\assembly ) for my assembly, then use the path option to load it if it...
View ArticleReply To: Remove AD group members from incorrect groups
Rob, Thank you very much for that. Unfortunately I don’t have the Quest AD Commandlets installed, but I was able to adapt your excellent suggestion to generate a csv list of ‘offending’ accounts,...
View ArticleReply To: Remove AD group members from incorrect groups
Glad you were able to figure it out with the example provided.
View Article