-
Below powershell helps to get the list of user count from the Active Directory $Domain = 'LDAP://DC=domain;DC=com' $Root = New-Object DirectoryServices.DirectoryEntry $Domain $select = New-Object DirectoryServices.DirectorySearcher $select.SearchRoot = $root $adobj= $select.findall() |? {$_.properties...
-
Some times we may wanted to get list of users last logon time. This command helps you the get list of all the users who lastlogontimestamp is older then 30 days or 60 days Get-QADUser -sizeLimit 0 | where {$_.lastlogontimestamp -lt (get-date).AddDays(-30)} | Select NAme,lastlogontimestamp Get-QADUser...
-
Widows 2008 R2 comes with powershell v2 by default. and added with 76 new Ad cmdlets and Ad provders New-ADOrganizationalUnit -Name "OUname" -ProtectedFromAccidentalDeletion $true This command creates new OU under the root. If we wanted created OU in specific path then we have to provide the...
-
Am trying to write my first script to solve a real need and my lack of experience with PS is showing. Any help would be appreciated..... Need to write a routine to do a bulk add of Computers to a Global Group. The computer names only are contained in an Excel file and need to be added to a group that...
Posted to
Active Directory
(Forum)
by
seberle
on
10-07-2010
Filed under: Active Directory, PowerShell, Active Directory Management, Add Group Membership, Group Membership
-
Howdy, I am trying a new script that is hopefully easier than the last I tried. I have a server that performs actions to create, modify, and disable user accounts. I have a command that retrieves the list of users I need to report on and now I am not sure how to get to the next steps of creating this...
-
Hi I am trying to use this script, it seems to work great. The problem I have is that I have multiple file servers where home folders exist, so I don't want it to prompt me for the file server name. I want to get the script to work so that it will find the users home folder path automatically, then...
Posted to
Active Directory
(Forum)
by
virtuallynothere
on
04-17-2012
Filed under: Active Directory, PowerShell, Active Directory Management, User, Search-ADAccount, Access Control Management, Scripting
-
I am trying to find a way to modify the script below or if anyone has a script that will delete home folders for a list of users if the user names are specified in a text or csv file, can anyone help? I would like to delete the user accounts as well, but the home folders is fine for now. I want to do...
-
I am trying to set a virtual attribute that currently exists for all users in a specific OU. I can retrieve the attribute value and user name fine using the command below, but then I tried to set the value and that fails in the command below, and also in the script below. I'm trying to get help on...
-
This is my very first script using Powershell so please excuse me. I'm sure there are cleaner ways to get this done. A little bit of background... This will run as a post-install after an image to join the user to our domain. After it successfully runs it will delete itself and then reboot. My problem...
Posted to
Active Directory
(Forum)
by
dugullett
on
04-30-2012
Filed under: Active Directory, PowerShell, Windows 7, Add Computers, User, Add Domain Group to Local Group, power shell
-
We have a Group that is made up of managers (those with direct reports) and want to run a PS script routinely to add and remove members of the group. I would think emptying and repopulating the group members would be the most efficient, but also wanted to see the changes as a sanity check. Here is what...