Monday, June 26, 2017

Windows Lockscreen leaks Clipboard content

Go to locked Workstation...

- Press Win+ENTER: Start Narrator
- CapsLock+F1: Open Narrator Help
- Ctrl+V: hello Clipboard content

I recommend to disabling these features through the appropriate Group Policy settings, to avoid that someone could get a password that was copied to clipboard.


Windows 8.1 and 10 are affected.






Monday, June 19, 2017

E-book: The Ultimate Guide to Windows Server 2016

DOWNLOAD the free e-book:

FOLLOW ME

Powershell: Set AD User "Name" with givenname and surname (it´s the Name that is displayed in ADUC)

Some guys mix up Name with Displayname. So with this command we will change the name you see in ADUC.



Get-aduser tbuntrock -Properties * | foreach { Rename-ADObject $_ -newname ($_.givenname + " " + $_.sn)}

Tuesday, June 13, 2017

Powershell: Disable AD User from csv and append Description

The file should contain the samaccountnames and looks like:
user1
user2
user3

Script:

$logfile = "C:\admin\VacationUsers.csv"
get-content $logfile |get-aduser -Properties Description | ForEach-Object { Set-ADUser $_ -enabled $false -Description "$($_.Description) DISABLED as requested by HR" }


How it works:
- Define file path
- Just get the users from csv
- Use get-aduser to get description
- do this for each user and...
- Set description


We keep the old Description with $($_.Description) and all that follows will be appended. In my example it is DISABLED as requested by HR.

POSHGUI

You can use the following website to build your own GUI.

https://poshgui.com

Thursday, March 30, 2017

Powershell 4 - Get authorized DHCP server

You can use the following command to get all authorized DHCP server:
Get-DhcpServerInDC

The output will be the IP and DNSName of the server.

You can add out-gridview to easy filter or copy it to Excel.
Get-DhcpServerInDC | Out-GridView

If you want to instant filter on name or IP address you can do it this way:
Name:
$DEDHCPs = Get-DhcpServerInDC | where {($_.DNSName –like “DE*”)}
$DEDHCPs

IP:
$ipDHCPs = Get-DhcpServerInDC | where {($_.IPAddress –like “10.15*”)}
$ipDHCPs


You can also write the output directly to a file. Just use export-csv:
Get-DhcpServerInDC | where {($_.IPAddress –like “10.15*”)} | Export-Csv c:\admin\dhcps.csv -NoTypeInformation

or using >c:\admin\dhcps.txt (same output like in PS)

Get-DhcpServerInDC | where {($_.IPAddress –like “10.15*”)} >c:\admin\dhcps.txt