Quantcast
Channel: PowerShell.org » All Posts
Browsing all 13067 articles
Browse latest View live

Reply To: Want scenarios for practice.

Consider visiting the Scripting Guys blog; they posted scenarios for the 2013 Scripting Games as well as past Scripting Games. Those would probably be good to start with. For example,...

View Article


Reply To: Automate GPO settings

Start with the resultant set of policy wizard in GPMC http://technet.microsoft.com/en-us/library/cc737701(v=WS.10).aspxHow are you trying to set the registry key?

View Article


Reply To: Want scenarios for practice.

Hi Don Jones, As I expected you are the first person who replied for my post. I am a big fan of you. I like your videos and the way you are explaining things. As you suggested I will check that link....

View Article

Reply To: Want scenarios for practice.

I’ll second Don’s advice. I’d also suggest looking at the questions in the forums and trying to create, or improve, a script to answer them. The final thought is to look at the things you do at work –...

View Article

Reply To: Want scenarios for practice.

Hi Richard,Thanks for your advice surly I will do that. I am working as a windows and exchange admin only but not in a place were I can see problems. I cannot explain also what I am doing sorry for...

View Article


Reply To: Automate GPO settings

Do you need to do this in the local GPO for some reason? (That’s what is viewed when you run gpedit.msc.) As has already been mentioned, setting this in a domain GPO would be the best approach.It’s not...

View Article

Casting for constants

I like the idea of creating constants (read-only variables) for data that will not change in a script. However, I have not been able to figure out how to cast a constant. For instance, I want to...

View Article

Reply To: Sort running services

Hey Nate,This is yet another way of looking at your scheduled tasks.$ErrorActionPreference = 'SilentlyContinue' Set-Location $ENV:SystemRoot\System32\Tasks Get-ChildItem | Where-Object...

View Article


Reply To: Casting for constants

Hey Bob,You can create custom PSObjects help New-Object -Full, you can create read only variables. new-variable -name max -value 256 -option readonlyVariables also have scope you can set “Global”,...

View Article


Set AD group gidNumber for multiple groups

Hi All I was hoping you might be able to guide me with my query below.I have a requirement to create multiple Active directory Groups (and users but not in this script) where the gidNumber has to be...

View Article

Copy OU Permissions and Groups

I have existing OUs but want to copy permissions and groups to a newly named OU and then have the names of the groups match the names of the newly created OU.Example: Existing OU named: GR8 Group...

View Article

Reply To: Set AD group gidNumber for multiple groups

Out of curiosity, how did you create the $groups variable? Is it from running Get-ADGroup, or from something like a database or CSV file? You don’t need to keep making multiple calls to Get-ADGroup....

View Article

Reply To: Set AD group gidNumber for multiple groups

Hi Dave,Thanks for you response apologies for missing this part in my original post.The $Groups variable is as per the following: $Groups = Import-Csv C:\Scripts\GroupsgidNumber.csv -UseCulture As per...

View Article


Reply To: Copy OU Permissions and Groups

I think it can be done, but the code will be a bit complex (working with ACLs always is; no one-liners here). Part of the code would probably look something like this: $sourceOU =...

View Article

Reply To: Set AD group gidNumber for multiple groups

OK, the code should just need a small update to include a single call to Get-ADGroup, then. Try this: foreach ($csvEntry in $groups) { try { $group = Get-ADGroup -Identity $csvEntry.SamAccountName...

View Article


Image may be NSFW.
Clik here to view.

Reply To: Set AD group gidNumber for multiple groups

Thanks Dave you are amazing Perfect! I think I will take a break now Below creates the new groups that are required and then modifies the gidNumber. $Groups = Import-Csv C:\Scripts\CSVFILE.csv...

View Article

Reply To: Set AD group gidNumber for multiple groups

You might be able to consolidate that code even further, eliminating the call to Get-ADGroup. I’m not at home, so I can’t test this code yet, but you can try it: $Groups = Import-Csv...

View Article


Reply To: Validate group members

Yeah it is done Dhandapani..:)

View Article

Reply To: Copy OU Permissions and Groups

Do the groups administer the contents of the OU?if so you can’t just copy the permissions on the old groups as they will refer to the old OU.

View Article

Reply To: Copy OU Permissions and Groups

Yes that’s what I was thinking. Do you have an idea of what I am trying to do and how to accomplish it then?# Get distinguished name of the AD Object to get ACL from and distinguished name of the AD...

View Article
Browsing all 13067 articles
Browse latest View live