Open PowerShell, type-
get-aduser -filter * -properties passwordlastset, passwordneverexpires |ft Name, passwordlastset, Passwordneverexpires
To Export to CSV-
Get-ADUser -filter * -properties passwordlastset, passwordneverexpires | sort-object name | select-object Name, passwordlastset, passwordneverexpires | Export-csv -path c:tempuser-password-info-20131119.csv
For enabled only-
get-aduser -filter 'enabled -eq $true' -properties passwordlastset, passwordneverexpires |ft Name, passwordlastset, Passwordneverexpires
To see an accounts creation date-
Friday, September 4, 2015
Saturday, August 15, 2015
Migrate VMDK (Virtual Hard Disk) from one VM to another, maintain permissions and file shares. EASY file migration!
File server migration - the easy way. Don't migrate files and change login scripts like a chump... :)
1) Get your current file server running on the same host as the new file server. (If physical, p2v it. If virtual, move it or v2v it.)
2) Open Regedit on the old file server, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer
3) Right Click on "Shares", click export. Copy this file to your new file server.
4) In vmware remove the data disk from the old file server. (Right click on VM, Edit Settings, click on the data hard disk, click remote. Make sure you do NOT click remove and delete files from disk, make SURE yous elect "Remove from Virtual Machine".
5) Rename the old server to something else. (If it's a DC, demote it, then rename it.)
6) Rename the new server to your old server's name. If it's to be a DC, delete the old computer account in AD and promote it.)
7) In VMware, add the drive. (Right click on VM, edit settings, add, Hard Disk, use and existing virtual disk, find the VMDK of the drive you are migrating.)
8) In Windows on the new server, make sure you add the drive with the same drive letter the old server had. (So if it was "D" on the old server, make sure it is "D" on the new server.
9) Import your registry file from step 2.
10) Reboot.
All permissions and shares will be exactly as they were before you started.
Thursday, July 16, 2015
How to see what mailboxes a specific user has Full Access to.
I recently was tasked with finding out which mailboxes a specific user and full access to. It took me a bit too find this with most providing way too much info.
Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission -User jsmith | Format-Table Identity, AccessRights, Deny
Proper Syntex to change public folder permissions recursive using powershell.
It took me enough google searches to figure this out that I decided to post it here. The issues seemed to be around the 'space' in the folder name.
Change directories to \Program Files\Exchange Server\Scripts
To add a user to a public folder and all subfolders in powershell use-
\AddUsersToPFRecursive.ps1 -Server "ExchangeServer" -TopPublicFolder "\Sales Folder" -User "JSmith" -Permissions
PublishingEditor
You can also do this if you want to add them to ALL public folders.
\AddUsersToPFRecursive.ps1 -Server "ExchangeServer" -TopPublicFolder "\" -User "JSmith" -Permissions
PublishingEditor
To REPLACE their permissions (say they have read access but you want them to have publishing editor), do this-
.\ReplaceUserPermissionOnPFRecursive.ps1 -Server "ExchangeServer" -TopPublicFolder "'\Sales Folder'" -User "JSmith" -Permissions PublishingEditor
Note- the folder is in both quote (") and with a tick (') around it. It doesn't work with just quotes.
Change directories to \Program Files\Exchange Server\Scripts
To add a user to a public folder and all subfolders in powershell use-
\AddUsersToPFRecursive.ps1 -Server "ExchangeServer" -TopPublicFolder "\Sales Folder" -User "JSmith" -Permissions
PublishingEditor
You can also do this if you want to add them to ALL public folders.
\AddUsersToPFRecursive.ps1 -Server "ExchangeServer" -TopPublicFolder "\" -User "JSmith" -Permissions
PublishingEditor
To REPLACE their permissions (say they have read access but you want them to have publishing editor), do this-
.\ReplaceUserPermissionOnPFRecursive.ps1 -Server "ExchangeServer" -TopPublicFolder "'\Sales Folder'" -User "JSmith" -Permissions PublishingEditor
Note- the folder is in both quote (") and with a tick (') around it. It doesn't work with just quotes.
Thursday, June 11, 2015
Removing duplicate lines in Notepad++
Often times I cut / paste between systems and end up with duplicate lines in Notepad++. Googling finds a lot of solutions that don't work. Here's all you need to do-
Hit <Ctrl> <H> to get to the replace box (or go to the Search menu and click Replace.)
In "Find What", put \r\n\r\n
In "Replace", put \r\n
Under Search Mode, check "Extended".
Click "Replace All".
Hit <Ctrl> <H> to get to the replace box (or go to the Search menu and click Replace.)
In "Find What", put \r\n\r\n
In "Replace", put \r\n
Under Search Mode, check "Extended".
Click "Replace All".
Wednesday, March 11, 2015
How to convert a Unix TXT file to Windows in Notepad++ (removing extra line spaces).
Hit <Ctrl> <H>
Select "Extended" under search mode.
In Find What, put "\r\n\r\n"
In Replace With, put "\r\n"
Select "Replace All"
Select "Extended" under search mode.
In Find What, put "\r\n\r\n"
In Replace With, put "\r\n"
Select "Replace All"
Friday, March 6, 2015
Easily determine what is running at startup, administer services, etc.
Autoruns is a great systinternals utility that allows you to easily administer the startup of any Windows OS.
https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx
https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx
Subscribe to:
Posts (Atom)