So I'm building a new PC and decided to record the specs;
Fractal Design Define R4 Arctic White with Window
Gigabyte GA-Z97X-SOC Force LGA 1150 Motherboard
Intel Core i5 4670K Quad Core LGA 1150 3.4GHz CPU Processor
Corsair Vengeance Pro 8GB (2x 4GB) DDR3 2133MHz Memory
Samsung 840 EVO 250GB 2.5" SATA III SSD MZ-7TE250BW
Seasonic P-860XP Platinum Series 860W Power Supply
Thermaltake Water 3.0 Pro Liquid CPU Cooler
Gigabyte GeForce GTX 780 Ti 3GB WindForce 3X Video Card
It's going to be pretty special when it's done.
The CPU will be replaced by a Devils Canyon i7 once they become available.
It's my first foray into liquid cooling but using an all in one unit kinda makes it a more approachable concept.
Update! - Here are some photos from the build
Tuesday, May 13, 2014
Friday, May 9, 2014
Everyday Powershell - Part 20 - Rollback system time and launch a program
So there are times where loading an older application requires you to rollback the date of your system. Our UPS management console has had this odd requirement since 2014. So we threw this together to make life a little easier;
set-date 01/01/2009
Start-Process "c:\windows\system32\notepad.exe" Start-sleep 15 set-date (invoke-command -ComputerName SOMECURRENTTIMESERVER -ScriptBlock {get-date}) |
You can update the process path in the second line, then save this as a .ps1 file and use it as a shortcut to launch time-bombed applications.
It does require the appropriate permissions on the sever we get the time from in the fourth line. It'll also need Powershell Remoting enabled.
Labels:
invoke-command,
powershell,
set-date,
start-process,
start-sleep
Wednesday, April 16, 2014
Everyday Powershell - Part 19 - Migrate Transport Rules from Exchange 2007 to 2013
Today's script is a quick and dirty fix for a project we're in the middle of. Not really a script either, but it's the thought that counts.
#on a computer with exchange 2007 management tools
Add-PSSnapin *exchange* export-transportrulecollection c:\scripts\exch2007transportrules.xml #on a computer with exchange 2013 management tools Add-PSSnapin *exchange* [Byte[]]$Data = Get-Content -Path '\\someserver\c$\Scripts\exch2007transportrules.xml' -Encoding Byte -ReadCount 0 Import-TransportRuleCollection -FileData $Data |
Export transport rules from Exchange 2007 and import them to 2013.
To think our System Admin was going to copy these over by hand!
Full credit to Microsoft for this one it is all from http://support.microsoft.com/kb/2846555
Full credit to Microsoft for this one it is all from http://support.microsoft.com/kb/2846555
Labels:
exchange,
export-transportrulecollection,
powershell
Wednesday, March 26, 2014
Everyday Powershell - Part 18 - Set Address Details in Active Directory
Here's a request from one of our readers. He's tidying up a negelected AD he inherited and needed a way to apply consistent addresses to his AD User Objects.
Powershell is great at this stuff! We've decided to use group membership as a way to decide who should get what data, but this could be easily applied via OU.
<# For this to work setup a CSV in C:\Scripts call it Groups.csv
And fill it with data like this;
SecurityGroup,Address,City,Zip,State,Country,Telephone
Group1,1 Some St,SomeTown,1122,SOMESTATE,AU,615551234
Group2,2 Some Other
St,SomeOtherTown,2211,SOMESTATE,AU,615554321 #>
$csvdata =import-csv C:\Scripts\Groups.csv foreach($row in $csvdata) { $users= Get-ADGroupMember $row.securitygroup foreach($user in $users) { Set-ADUser $user -StreetAddress $row.Address -city $row.city -State $row.State -Postalcode $row.Zip -Country $row.Country -OfficePhone $row.Telephone } } |
Just a simple script with two loops, first one iterates through the rows in the CSV the second group steps through each user in the security group identified in the initial loop.
Nothing fancy but it fixed our readers problem. Such is the power of the shell!
Labels:
get-adgroupmember,
import-csv,
powershell,
set-aduser
Wednesday, March 19, 2014
Everyday Powershell - Part 17 - Using new-mailboxexportrequest with NON-US dates
Here's a crazy making problem!
The new-mailboxexportrequest commandlet will only accept dates in US formats. Roland Paix has made this post about the issue. The conclusion is switch your culture to EN-US before loading powershell. Sooo frustrating! But hey, something has to be the default datetime and Microsoft is an American company. No point getting emotional, let's just fix it.
Here's a neat trick you can use to set the Culture of the "Current Thread" you are running.
The new-mailboxexportrequest commandlet will only accept dates in US formats. Roland Paix has made this post about the issue. The conclusion is switch your culture to EN-US before loading powershell. Sooo frustrating! But hey, something has to be the default datetime and Microsoft is an American company. No point getting emotional, let's just fix it.
Here's a neat trick you can use to set the Culture of the "Current Thread" you are running.
[System.Reflection.Assembly]::LoadWithPartialName("System.Threading")
[System.Reflection.Assembly]::LoadWithPartialName("System.Globalization") [System.Threading.Thread]::CurrentThread.CurrentCulture = [System.Globalization.CultureInfo]::CreateSpecificCulture("en-us") Add-PSSnapin *exchange* $start = (get-date).adddays(-28) $end = (get-date).adddays(-14) $filter = "(Received -gt '"+$start+"') -and (Received -lt '"+$end+"')" new-Mailboxexportrequest -mailbox SOMEMAILBOX -ContentFilter $filter -filepath C:\SOME.pst |
This should trick new-mailboxexportrequest into believing that your dates are in the "correct" format!
Wednesday, March 12, 2014
Everyday Powershell - Part 16 - Monitoring Disk Performance in Powershell
Welcome back to another Everyday Powershell post. It's not powershell we POST every day, it's powershell you could USE everyday.
Today we look at get-counter which you should have a fiddle with if you get the chance. It does a lot more than what we've used it for here. But this may help you get the gist of running performance counters in powershell.
Today we look at get-counter which you should have a fiddle with if you get the chance. It does a lot more than what we've used it for here. But this may help you get the gist of running performance counters in powershell.
$disks = Get-WmiObject win32_logicaldisk | Where-Object {$_.DriveType -eq 3} | select DeviceID
$report = @() $i=1 foreach ($disk in $disks) { Write-Progress -Activity "Mesuring disk performance" -Status $disk.DeviceID -PercentComplete (($i/$disks.Count)*100) $temp = "" | select Disk, Read, Write $temp.disk = $disk.deviceid $counter = "\LogicalDisk(" + ($disk.deviceid) + ")\Avg. Disk sec/Read" $temp.read = ((Get-Counter -Counter $counter).CounterSamples.cookedvalue)*1000 $counter = "\LogicalDisk(" + ($disk.deviceid) + ")\Avg. Disk sec/Write" $temp.write = ((Get-Counter -Counter $counter).CounterSamples.cookedvalue)*1000 $report += $temp $i++ } $report |
We've included the now ubiquitous write-progess to give a useful progress indicator. As well as the old $temp="" | select which sets up a hash table for us to dump data into.
Labels:
get-counter,
get-wmiobject,
powershell,
write-progress
Thursday, February 27, 2014
Everyday Powershell Returns! - Find exchange mailbox size
Fresh from an ass kicking at the Winter Scripting games we're back with another useful bit of Powershell!
We're building our Exchange 2013 environment now and have a burning need to see what our users mailboxes look like, in terms of the space they consume.
This little script did the trick for us and helped us plan our new information store layout.
We're building our Exchange 2013 environment now and have a burning need to see what our users mailboxes look like, in terms of the space they consume.
This little script did the trick for us and helped us plan our new information store layout.
Add-PSSnapin *exchange*
$users = Get-ADUser -searchbase "DC=somedomain,DC=com" -Filter * -Properties department $report = @() $count = $users.count $i = 0 foreach ($user in $users) { $i++ $prog = ($i/$count) * 100 Write-Progress -Activity "Processing..." -percentcomplete $prog -CurrentOperation $user.samaccountname $temp = ""| select Person, mailboxsize, itemcount, Team, Function $mailboxstats = Get-MailboxStatistics $user.samaccountname $temp.person = $user.samaccountname $temp.mailboxsize = $mailboxstats.totalitemsize.value.toMB() $temp.itemcount = $mailboxstats.itemcount $temp.team = $user.department $report += $temp } $report |
Should be pretty self explanatory. Ask a question in the comments if you'd like clarification of anything.
Labels:
get-aduser,
get-mailboxstatistics,
powershell,
write-progress
Subscribe to:
Posts (Atom)