# Out puts computer accounts including status Enabled True or False # Targets a specific OU # Lists computer names # OU Variable to set $OU_HotWiredUK_location = "OU=Computers,OU=HotWiredHQ,OU=UK,DC=test,DC=com" # Out…
Task : Output A List Of Home Drive Paths Configured In Active Directory
#DSQuery dsquery user -name "*" -limit 0 | dsget user -samid -hmdir -hmdrv -profile >c:\temp\usersV2.txt #PowerShell # More flexibility # Includes the state of the computer account (Enable or…
List all users in the domain and email addresses
import-module activedirectory #List all users in the domain # Display Name and Email Address get-aduser -Filter * -SearchBase "dc=Test,dc=com" -Properties Displayname,emailaddress | select displayname ,emailaddress | Export-Csv C:\temp\users_and_email.csv
Get a list of active users which have logged on to the domain in the last 7 days
# Get a list of users which have logged on to the domain in the last 7 days $Date = (Get-Date).AddDays(-7) Get-ADUser -Filter {LastLogonDate -gt $Date} | Select distinguishedName
PowerShell Script to find all AD users who have the “cannot change password” box checked in a specific OU
# script to find all AD users who have the "cannot change password" box checked in a specific OU # Windows Server 2016 # Powershell Get-ADUser -Filter * -Properties CannotChangePassword…
Create an ISO file with PowerShell post by Ben Liebowitz
Recently I came across this post. As a VMware admin, you often want to create an ISO as a quick method to copy files or installation files to a VM.…
List Computer Object in an Active Directory OU using PowerShell
How to get a list of computer objects in an active directory OU ( tested against Windows 2016 Active Directory ) A quick PowerShell script using Get-ADComputer command, a wild…
Sysinternals – Permissions, LoggedOn, Endpoints
How to Get the permission on folders: PowerShell: Get-ChildItem | Get-ACL Path | Owner | Access or more in depth use: GUI based : Run AccessEnum against the drive or…
Get-AdUser -Filter {Multiple Filters Complex } -Properties | Export to CSV
#Import AD modules import-module servermanager Add-WindowsFeature -Name "RSAT-AD-PowerShell" -IncludeAllSubFeature #List AD user accounts and show DisplayName, Email, Title and export to CSV Get-ADUser -Filter * -Properties DisplayName, EmailAddress, Title |…
Get a list of active computers which have logged on to the domain in the last 7 days
# Trying to work out is servers, laptops or desktops have been decommissioned # Try this script # Get a list of active computers which have logged on to the…