Categorywindows

Find domain admins with password never expires

Do you know how many domain admins you have in your domain? Do you know which domain admins are running with “password never expires” enabled? Thanks to Powershell it is easy to find out.


# Variables below
#
$domainadmins=(Get-ADGroupMember -Identity "Domain admins" | Get-ADUser -Properties PasswordNeverexpires, lastlogondate)
#*********************************************************************************************
# Output to screen
$domainadmins | Sort -Descending -Property PasswordNeverexpires | Select-Object Name, Samaccountname, lastlogondate, Enabled, PasswordNeverExpires | ft -autosize
#

This will display on your screen all members in “Domain Admins” with the last logon time, if the account is enabled and if the “password never expires” is set.

If you want a file export you can use this line instead of output to screen:


# Output to file
$domainadmins | Sort -Descending -Property PasswordNeverexpires | Select-Object Name, Samaccountname, lastlogondate, Enabled, PasswordNeverExpires | Export-Csv C:\Temp\domainadmins.csv -Encoding UTF8 -Delimiter ","

Create a Windows Bootable usb pendrive (windows Vista, 7, 8, 8.1, 10, Server 2008, 2008R2, 2012 and 2012R2)

This procedure lets you install Windows from a usb pendrive. Works from Vista/2008 and later

First you need

* Usb pendrive of at least 4GB (Content will be erased)

* Windows installation medium or iso. Windows Vista or later

Prepare usb pendrive

* Insert the pendrive in an available port and copy any data you need to preserve to another locaiton

* Open an elevated commandprompt (“run as administrator”)

* Write “diskpart” and press enter

* Inside diskpart write “list disk” and identify the number for the pendrive.

* Enter the following command, in the example below the pendrive is disk 1 in diskpart.

SELECT DISK 1
CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS QUICK
ASSIGN
EXIT

* Copy the content of the Installation medium to the pendrive or extract the iso-file using 7-zip or similar program

Then you should be all set, remember the boot order in BIOS when you want to boot from the pendrive.

© 2020 IdefixWiki

Theme by Anders NorénUp ↑