Rexxer

Some tips for me and other

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

DHCPD + Classes e.g. MAC-address

subnet 192.168.30.0 netmask 255.255.255.0 { option routers 192.168.30.1; option domain-name-servers 192.168.30.11, 192.168.30.2; class “Hyper-V” { match if substring(hardware,1,3) = 00:15:5d; } class “VMWare” { match if substring(hardware,1,3) = 00:0c:29; } class “Winemu” { match if substring(hardware,1,3) = 00:03:ff; } pool { range 192.168.30.100 192.168.30.130; allow members of “Hyper-V”; } pool { range 192.168.30.131 192.168.30.160; allow […]

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

Zabbix 3 + Adding VMWare hosts

Create vSphere host Add 4 macros: – {$USERNAME} – username which has an administrative privileges on VMware – {$PASSWORD) – password for username – {$URL} – https://10.10.10.10/sdk (where 10.10.10.10 is the address of vSphere host, not VMware supervisor) – {$UUID} – $UUID can be obtain by requesting the hypervisor webservices like https://hostname/mob/?moid=ha-host&…are.systemInfo You will see […]

Zabbix 3 Appliance + Extend disk space

Extend HDD in your VM on Hyper-V, ESXi, … Rescan drives in VM: echo “- – -” > /sys/class/scsi_host/host#/scan Check it: fdisk -l Create a new partition with code 8E (Linux LVM): cfdisk /dev/sda Reboot (or reread info about disks) Create new partition for LVM: pvcreate /dev/sda6 Extend LVM (vg_name was zabbix-vg in my case): […]

Certificate + Add a private key

Copy-pasted from: http://www.entrust.net/knowledge-base/technote.cfm?tn=7905 Entrust Certificate Services Support Knowledge Base Audience: General Last Modified: 2011-01-18 08:42:02.0 TN 7905 – What are the steps to recover the private key of an SSL certificate in an IIS environment? Problem: The SSL certificate is installed but the private key is missing. What are the steps to recover the private […]

Exchange + Search mail

get-mailbox -resultsize unlimited | Search-Mailbox -SearchQuery ‘attachment:”Filename”‘ -TargetMailbox UserName -TargetFolder “FolderName” -LogOnly -LogLevel Ful another lookup: Search-Mailbox -Identity “vasya.pupkin” -SearchQuery “to:domainname.com” -TargetMailbox “ivan.ivanov” -TargetFolder “Folderame” -LogLevel Full

Exchnage + Restore Deleted Items between dates

Search-Mailbox -identity ivan.ivanov -SearchDumpsterOnly -SearchQuery “Received:2016-01-01..2016-04-01” -TargetMailbox ForDeletedMail -TargetFolder RestoredDeleted Another example: Search-Mailbox Superman -SearchDumpster -SearchQuery “(Received:1/1/2012..5/18/2016) AND (To:Batman@DC.com OR From:Batman@DC.com OR CC:Batman@DC.com OR BCC:Batman@DC.com OR ‘Batman’ OR ‘Bruce’ OR ‘Wayne’)” –targetmailbox BobTheLawyer -loglevel full -targetfolder “Search_Batman” Keywords for SearchQuery: https://msdn.microsoft.com/library/ee558911%28v=office.15%29.aspx?f=255&MSPPError=-2147217396 Script (I haven’t try it): https://blogs.msdn.microsoft.com/emeamsgdev/2012/04/27/powershell-script-to-recover-all-deleted-items-in-a-mailbox/

Previous Posts Next posts