Some tips for me and other


Windows Firewall + Too many entries in the eventlog

To turn off audit for these messages go to the GPO: Computer configuration –> Policies –> Windows settings –> Security settings –> Advanced audit policy configuration –> Audit policies –> Object access. “Audit Filtering Platform Connection” and check only the box next to “configure the following audit events.” DO NOT CLICK THE OTHER TWO BOXES. […]

Powershell + Get users from specified groups

$Groups = “ip”,”team”,”Managment”,”mott” ForEach ($Group in $Groups) { write-host “#” write-host “Group:” $Group write-host “===============================” $gr = Get-ADGroupMember -identity $group echo $ write-host “===============================” }

Powershell + Logoff inactive users

We have shared PCs and some people leave their sessions locked. Their audio processes (Skype, players, etc …) still work and it’s the problem. I wrote the script which runs at a user logon and logoff these inactive users. function Get-Sessions { $queryResults = query session $starters = New-Object psobject -Property @{“SessionName” = 0; “UserName” […]

Powershell + Time elapsed

$sw = [Diagnostics.Stopwatch]::StartNew() ping -l 10 $sw.Stop() $sw.Elapsed $res = “Elapsed: ” + $sw.Elapsed.Hours + ” hours ” + $sw.Elapsed.Minutes + ” minutes ” + $sw.Elapsed.Seconds + ” seconds” echo $res

Windows 10 + .Net 3.5 install issue

Following command can be used to install .NET 3.5 on Windows 10 without internet connection: Dism.exe /online /enable-feature /featurename:NetFX3 /source:F:\sources\sxs /LimitAccess Where, F: is your installation media. Also, there’s tool to install .NET 3.5 offline from your existing Windows 10 installation media: Source:

Logoff inactive users

The first variant: use winexit.scr from Windows 2003 Toolkit. The minus: it doesn’t help if a user lock his account and another user is switched. The plus: there is an announcement and countdown. The worked solution: use iddlelogoff.exe from Intelliadmin (free): Download Open Group Policy Managment console and create a new policy for an […]

Powershell + turn on system protection

enable-computerrestore -drive “c:\” vssadmin resize shadowstorage /on=c: /for=c: /maxsize=3%

Create UEFI booting flash

run diskpart and: select disk N clean create partition primary format fs=fat32 quick active assign list volume exit Copy Win10 files from ISO to flashdrive.

Powershell + Remote

Run powershell on the remote PC and run it: Enable-PSRemoting -Force Set-Item wsman:\localhost\client\trustedhosts * Restart-Service WinRM Test the connection from the local PC: Test-WsMan COMPUTERNAME Run the remote command: Invoke-Command -ComputerName COMPUTERNAME -ScriptBlock { COMMAND } -credential USERNAME

Get-ADUser scripts

Get users with the specified manager: Get-ADUser -Filter { Manager -eq “CN=Ivan Ivanov,OU=Users,DC=contoso,DC=com” } -Properties Mal, Title | ft Name, Title Do not forget to run before: import-module ActiveDirectory Get info about users which are in the group: Get-ADGroupMember groupname | Get-ADUser -Properties Name, Title | ft Name, Title

Previous Posts Next posts