move all member of OU to new-distributiongroup - windows

I'm trying to set up some new distributiongroups and want to fill them with all members of an specific OU.
$allMemberofTestOU = get-qadgroup $ouNameT | get-qadmemberof
but my exchange management shell dont know this cmdlet. i dont know why.
I dont get the point how i can do this, i guess - simple, thing.
Long Version:
I have many OU which named like OU-ProgramName-** and want to move all of these members to an new distributiongroup name VL-ProgramName-**.
At the beginning, i get the content from a textfile with all Programnames and want to loop via ForEach (works).
Question:
I need help at getting all members of an OU and copy them to a new distributiongroup.
Best regards from germany
Paul
Edit:
I built another way to do the job. Im new to powershell, so i dont know if im doing it the right way.
$OU = "CN=*-$ouName,OU=Prodfarm-Anwendungen,OU=LRA-CTRX,DC=kreis-gr,DC=de”
$AD = New-Object System.DirectoryServices.DirectorySearcher([ADSI]"LDAP://$OU")
# Testfarm
$newGroupT = "VLP_"+ $ouName + " Test C65"
$Users = $AD.FindAll() | %{$_.Properties.samaccountname} | Sort-Object
$Users | New-Distributiongroup -Name $newGroupT -Members $_

All Get-QAD*CMDLets are part from the Quest ActiveRoles Management Shell plugin. There was a free version out there before Quest was bought by Dell. The free version is the reason why some blog posts refer to use them. However after the merge the free version was pulled from the Quest/Dell website and you can buy this plugin now directly from Dell/Quest here.
So your issue could be solved with two possible solutions:
1.) If you have installed the plugin, then you didn´t add the Quest ActiveRoles AD management snap-in at first via:
Add-PSSnapin Quest.ActiveRoles.ADManagement
2.) The Quest ActiveRoles AD management snap-in isn´t installed. If you wish to use the last known "free" version you can find that in the internet for example here. Keep noted that nobody knows if this is the original version! Keep also noted that the free version is a very old version as the current one is version 1.7. So you might also buy the new and latest one from Quest/Dell.
Update:
Here is a script I´m using which can add all users from a given OU to a given AD group. I run it via the Windows Scheduler and an task account. Once it run, it is adding all users from the given OU to an given AD group, means its auto updating the groups. You might adjust that one so that it fits your needs. Its a little bit advanced coding as it send out an error email if something failed, writes a log and used a function.

Related

Automatise Adduser for Windows Active Directory 2008

I would like to add a lot of users into my Active Directory Users Group based on a csv with specifics informations like phone numero, email, job ...
I look around the internet and found a "method" using powershell. But, it's always to add basic infos like Name, Surname, Login and password.
Is there a webpage referencing the New-ADuser cmd ?
I found something on this website
http://blogs.technet.com/b/pascals/archive/2013/08/09/cr-233-er-des-utilisateurs-de-test-dans-ad-avec-un-mini-script-powershell.aspx
Thanks,
I usually use the Quest AD cmdlets which makes easier the AD manipulation.
You can download the cmdlets from here.
You can also add phone number, webpage, etc. by default, or you can use the -IncludedProperties for addition.
Here is the syntax for the new user creation.

How to add an application to Apache Brooklyn catalog

I am trying to add applications into Brooklyn catalog. can anyone explain steps to add a new application to catalog.xml?
I did try the sample catalog provided at https://brooklyn.incubator.apache.org/v/0.7.0-M1/use/guide/quickstart/policies-and-catalogs.html . The application gets listed in catalog tab but when I try to launch it, it gets stuck at 'configuring'. Is there something else that needs to be done ?
I tried adding existing application to catalog ( https://brooklyn.incubator.apache.org/v/latest/ops/catalog/index.html ) but it failed. Can anyone help me with this ?
I'd strongly recommend upgrading to 0.7.0-M2-incubating, as the catalog has significantly improved since 0.7.0-M1. The documentation at https://brooklyn.incubator.apache.org/v/latest/ops/catalog/index.html describes the steps for 0.7.0-M2-incubating; they will not work for 0.7.0-M1.
The link to an explicit version of the docs (rather than latest) is https://brooklyn.incubator.apache.org/v/0.7.0-M2-incubating/ops/catalog/index.html
There are also more improvements in snapshot (and in existing pull requests), if you fancy trying the bleeding edge!
For the 0.7.0-M1 error "gets stuck at configuring", we'd need more info (e.g. logs, etc). Suggest you e-mail the mailing list or jump on IRC if it's still a problem (https://brooklyn.incubator.apache.org/community/mailing-lists.html).

How to write script to download csv file of ideas for product category in google adwords

I want download search volume trends from google adwords based on the target location and product category. Can Someone guide me to write a script that can automate the process.
If download is not possible, let it share to my google drive account with the specified name(category name)
Edit:
I am trying to automate the below process for an Adwords - Keyword planner.
Login to adwords
Select Target location
Input Category and click on Get Ideas
Downloading the keyword ideas as CSV and save it.
Something like a PHP bot
Since you're considering
to write a script that can automate the process
One way this can be done, is via PowerShell's WebClient. And it's .DownloadFile Method (String address, String fileName). The scripts (Cmdlets) actually are specialized .NET classes, which the PowerShell runtime instantiates and invokes when they are run. Cmdlets derive either from Cmdlet or from PSCmdlet, the latter being used when the cmdlet needs to interact with the PowerShell runtime. Also The implementation of these cmdlet classes can refer to any .NET API and may be in any .NET language.

How can I work with Windows security groups without knowing their localized names in advance?

I've searched around online but can't find what I'm after. Basically, during an install, we fire off a separate executable that basically brute forces a few folders to be read/write enabled for the user group "EVERYONE".
Now, the person that wrote this never took into consideration system language. I had a call with a customer in France that kept failing installation because "EVERYONE" isn't what we would expect.
I'm after an API call to Windows that would return a security group name which would be "safe" to use in a localized environment. Essentially I'm looking to safely edit this code so instead of hardcoding in "EVERYONE", we call a function instead.
The fundamental mistake here is not so much the use of EVERYONE, but rather that the code is using names at all. Instead of using names you should use the well-known SIDs. In your case you need S-1-1-0.

Windows / Active Directory - User / Groups

I'm looking for a way to find a the windows login associated with a specific group. I'm trying to add permissions to a tool that only allows names formatted like:
DOMAIN\USER
DOMAIN\GROUP
I have a list of users in active directory format that I need to add:
ou=group1;ou=group2;ou=group3
I have tried adding DOMAIN\Group1, but I get a 'user not found' error.
P.S. should also be noted that I'm not a Lan admin
Programatically or Manually?
Manually, i prefer AdExplorer, which is a nice Active directory Browser. You just connect to your domain controller and then you can look for the user and see all the details. Of course, you need permissions on the Domain Controller, not sure which though.
Programatically, it depends on your language of couse. On .net, the System.DirectoryServices Namespace is your friend. (I don't have any code examples here unfortunately)
For Active Directory, I'm not really an expert apart from how to query it, but here are two links I found useful:
http://www.computerperformance.co.uk/Logon/LDAP_attributes_active_directory.htm
http://en.wikipedia.org/wiki/Active_Directory (General stuff about the Structure of AD)
You need to go to the Active Directory Users Snap In after logging in as a domain admin on the machine:
Go to start --> run and type in mmc.
In the MMC console go to File -->
Add/Remove Snap-In Click Add Select
Active Directory Users and Computers and select Add.
Hit Close and then hit OK.
From here you can expand the domain tree and search (by right-clicking on the domain name).
You may not need special privileges to view the contents of the Active Directory domain, especially if you are logged in on that domain. It is worth a shot to see how far you can get.
When you search for someone, you can select the columns from View --> Choose Columns. This should help you search for the person or group you are looking for.
You do not need domain admin rights to look at the active directory. By default, any (authenticated?) user can read the information that you need from the directory.
If that wasn't the case, for example, a computer (which has an associated account as well) could not verify the account and password of its user.
You only need admin rights to change the contents of the directory.
I think it is possible to set more restricted permissions, but that's not likely the case.
OU is an Organizational Unit (sort of like a Subfolder in Explorer), not a Group, Hence group1, 2 and 3 are not actually groups.
You are looking for the DN Attribute, also called "distinguishedName". You can simply use DOMAIN\DN once you have that.
Edit: For groups, the CN (Common Name) could also work.
The full string from Active Directory normally looks like this:
cn=Username,cn=Users,dc=DomainName,dc=com
(Can be longer or shorter, but the important bit is that the "ou" part is worthless for what you're trying to achieve.
Well, AdExplorer runs on your Local Workstation (which is why I prefer it) and I believe that most users have read access to AD anyway because that's actually required for stuff to work, but I'm not sure about that.
Install the "Windows Support Tools" that is on the Windows Server CD (CD 1 if it's Windows 2003 R2). If your CD/DVD drive is D: then it will be in D:\Support\Tools\SuppTools.msi
This gives you a couple of additional tools to "get at" AD:
LDP.EXE - good for reading information in AD, but the UI kinda stinks.
ADSI Edit - another snap-in for MMC.EXE that you can both browse AD with and get to all those pesky AD attributes you're looking for.
You can install these tools on your local workstation and access AD from there without domain admin privileges. If you can log on to the domain, you can at least query/read AD for this information.
Thanks adeel825 & Michael Stum.
My problem is, though, i'm in a big corporation and do not have access to log in as the domain admin nor to view the active directory, so i guess my solution is to try and get that level of access.

Resources