Powershell + Time elapsed
$sw = [Diagnostics.Stopwatch]::StartNew() ping -l 10 192.168.2.2 $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: http://www.techgainer.com/tools/net-framework-3-5-offline-installer-windows-10-8-x/ Source: http://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_install/how-to-instal-net-framework-35-on-windows-10/450b3ba6-4d19-45ae-840e-78519f36d7a4
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 http://www.intelliadmin.com/idlelogoff.exe 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.
FTP-log + get IP-addresses
cat ftp.txt | grep incorrect | awk ‘{print $8};’ | tr -d “(” | tr -d “)>” | sort -u
PFSense + import DHCP-mappings from dhcpd.conf
I wanted migrate my static mapping from my dhcpd.conf to PFSense. Script to parse data from dhcpd.conf to xml-text: #!/usr/bin/awk -f # # Author: Matt Pascoe – matt@opennetadmin.com # Forked: Konstantin Shalygin – kostya@opentech.ru # Forked2: Rexxer, for PFSense # USAGE: # ./dhcpparse.awk /etc/dhcpd.conf # Note that for hosts, it will try a reverse lookup […]
Exchange 2010 + Default Folder Permissions
Exchange 2007 CAS Role VDir Authentication SSL Management done through Default Web Site Anonymous Yes IIS and HTTP Keep Alive should be on /Owa Basic Yes EMC/Powershell /Exchange Basic Yes EMC/Powershell /Public Basic Yes EMC/Powershell /Exchweb Basic Yes EMC/Powershell /Oab Integrated No EMC/Powershell /Autodiscover Basic and Integrated Yes Powershell /Ews Integrated Yes Powershell /UnifiedMessaging Integrated […]
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