Skip navigation

Category Archives: Technology

Discussion on any and all tech related items. New tech, tech usage, etc.

So I’ve been playing Planetside 2 lately.  I’ve been playing as New Conglomerate with an outfit called The Iron Wolves [TIW] on Waterson.  Coincidentally Planetside 2 is heading towards MLG and in the war report interview this past Sunday Higby in an interview with Alex “Jax” Conroy has revealed a lot of what that will entail (finally!).

Anyway, I’ve not made a post since mother’s day so I thought I’d link the youtube replay of our match from this past Friday against VREV and TRAF.  The second objective battle is by far one of the best (in around 10 minutes), with the third base capture having some entertaining points.

As some of you know, I’ve been working on CM 2012 for a while now, and establishing a hierarchy.  One of the unfortunate tasks with this job has been boundary creation.  Finally after a longer period than it should have taken I went to build a tool to create site boundaries for me out of a csv, similar to tools with SCCM 2007.

I found the sms_boundary class hadn’t changed (outside of an obsolete boundaryflag property) so I decided to test it out with powershell as a one liner, and it worked great.  I did a bit more research and stumbled across something already written by MVP Kaido Järvemets from Estonia, and enjoyed his minimalistic script for it so I followed his methodology (mostly) and ended up with this script that reads from a boundaries.csv file

boundary

 

$sitecode = "ABC"
$siteserver = "mysiteserver"
$boundarylist = Import-Csv '.\boundaries.csv'

foreach($Item in $boundarylist)
{Switch($item.'type')
	{"Subnet" 	{$Type = 0}    
	 "AD" 		{$Type = 1}
     "IPv6" 	{$Type = 2}
     "Range" 	{$Type = 3}}
$arrValues = @{DisplayName = $Item.description; BoundaryType = $Type; `
Value = $Item.boundary}
Set-WmiInstance -Namespace "Root\SMS\Site_$sitecode" -Class SMS_Boundary `
-Arguments $arrValues -ComputerName $siteserver}

Not to take credit for other peoples work, especially since this is a hacked up version of his original which can be found here.

Laziness is the true mother of necessity I think in IT, and the tedious act of viewing multiple properties pages brought about this one liner.  If you too are setting up diverse deployment sets and need to quickly verify multiple deployments for reboot supression state. Here’s a way to do it in powershell:

gwmi -namespace "root\sms\site_<sitecode>" 
-query "select assignmentname from sms_updategroupassignment 
where assignmentname like '%<NAME SEARCH VALUE>%' and suppressreboot = '3'"
 -ComputerName <SITESERVERNAME> |Select -Property assignmentname

<chopped up for readability sake>

Suppressreboot values:
0 = No Suppression
1 = Workstation Suppression
2 = Server Suppression
3 = Server & Workstation Suppression

replace <> values with your relevant search criteria.

More class information.

Just a link, but well done.

http://martinvalasek.com/blog/pictures-from-a-developers-life

Animated gifs to describe the day to day of a developer; or most personnel in an engineering level role of IT.

So this is a quick blog for a frustrating issue, that is actually very easy to resolve.

If you are on Windows Server 2012, and you’ve had to reinstall WSUS for any reason and receive the following error in your tmp log after attempting to finalize the installation:

2013-02-20 16:04:17  Creating default subscription.

2013-02-20 16:04:17  Instantiating UpdateServer

2013-02-20 16:04:19  CreateDefaultSubscription failed. Exception: System.Net.WebException: The request failed with HTTP status 503: Service Unavailable.

   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

   at Microsoft.UpdateServices.Internal.ApiRemoting.GetServerVersion()

   at Microsoft.UpdateServices.Internal.DatabaseAccess.AdminDataAccessProxy.GetServerVersion()

   at Microsoft.UpdateServices.Internal.BaseApi.UpdateServer.CreateUpdateServer(String serverName, Boolean useSecureConnection, Int32 portNumber)

   at Microsoft.UpdateServices.Internal.BaseApi.UpdateServer..ctor(Boolean bypassApiRemoting)

   at Microsoft.UpdateServices.Setup.StartServer.StartServer.CreateDefaultSubscription()

2013-02-20 16:04:19  StartServer encountered errors. Exception=The request failed with HTTP status 503: Service Unavailable.

2013-02-20 16:04:19  Microsoft.UpdateServices.Administration.CommandException: Failed to start and configure the WSUS service

   at Microsoft.UpdateServices.Administration.PostInstall.Run()

   at Microsoft.UpdateServices.Administration.PostInstall.Execute(String[] arguments)

It’s most likely an IIS issue.

Open the IIS console, delete the WSUS Site, and perform the post installation tasks again.

Something like that anyway….

 

I plan on posting more stuff in the future after things have normalized.

Soooo……

After GatherWriterMetadata SMS Writer status = FAILED_AT_PREPARE_BACKUP. SMS_SITE_BACKUP 2/4/2013 3:32:38 PM 8500 (0x2134)
Error: VSS_E_WRITERERROR_TIMEOUT. Error Code = 0x80,042,3f2. SMS_SITE_BACKUP 2/4/2013 3:32:38 PM 8500 (0x2134)

vssadmin list writers

Capture

hmmmm, it’s there.  Let me check the sms_site_sql_backup service on the database servers.

Ok, lets check our permissions on the servers to make sure machines have local admin, share permissions, and that they have SA rights.

Hmmm, are the backup components installed on the SQL nodes?

They are,  sorta, but aren’t installed on the static drives of our SQL server nodes, this is a problem…

 


It all starts with our old friend NO_SMS_ON_DRIVE.SMS

 

So make sure it’s where it needs to be, like on SAN drives.  Especially a SANS drive tied to SQL Cluster that will be failing over.  You don’t want to manually re-point components; but in case you do (or in our case NEED to)…. here’s how:

Get on every drive that DOESN’T need sms site components installed to them and place NO_SMS_ON_DRIVE.SMS in their root.

Now open your registry on the site server and go to:

hklm\Software\Microsoft\SMS\Components\SMS_SITE_COMPONENT_MANAGER\Multisite Component Servers\<servername>\Installation Directory

Change this path to the preferred static drive on the respective servers.  Now:

net stop sms_site_component_manager
net stop sms_executive
net start sms_site_component_manager

Now check sitecomp.log for your server name, verify the installation and connection.  Now lets check the local drives of the component sql server and verify the installation path we declared earlier.

Is it there?  If so, great, if not….

Open services and look for:

SMS_SITE_SQL_BACKUP_<site servername>

Go to properties and check it’s local path.

Stop the SMS_SITE_SQL_BACKUP_<site servername> service

Now open the registry and go to

hklm\System\CurrentControlSet\services\SMS_SITE_SQL_BACKUP_*\ImagePath

Specify the local drive and path you wish to use and now move the contents from the previous service to it’s new home.

You’ll need to verify and do the same for the log files:

hklm\Software\Microsoft\SMS\Tracing\SMS_SITE_SQL_BACKUP<site servername>\TraceFilename

Now:

Start the SMS_SITE_SQL_BACKUP_<site servername> service

Rinse, and repeat until they are where they need to be, and finally perform and verify the backup completes:

(from the site server)

net start sms_site_backup

and watch the smsbkup.log


Props to MS PFE Sean MAHONEEEEEEY! For his assistance

I’ve updated the inventory enforcement script and post for anyone who utilizes it. It should be cleaner now as it only depends on wmi for the inventory actions.

Here’s the link back.

So in an attempt to quickly extract OS version and Service Pack for a few machines in an environment the idea was presented to pull the data from active directory. The properties exist so the logic seemed sound; and as we’ve discussed this before it’s a pretty easy task with the active directory module in PowerShell, and here’s the code:

$list = gc computers.txt
Import-Module ActiveDirectory
ForEach($item in $list){
                $ado = (get-adcomputer $item -Properties *)
                $pso = New-Object PSObject
$pso | Add-Member -Name "Computer Name" -MemberType NoteProperty `
		-Value $ado.CN
$pso | Add-Member -Name "Operating System" -MemberType NoteProperty `
		-Value $ado.OperatingSystem
$pso | Add-Member -Name "Service Pack" -MemberType NoteProperty `
		-Value $ado.OperatingSystemServicePack
$pso
}

Assuming for the sake of example the name of this script is, get-adservicepack.ps1, and you’ve got your computers.txt file with your computer names in it then we’d run it like this.

./get-adservicepack.ps1 | export-csv -NoTypeInformation MyAdOutput.csv

So what’s happening?

First, we’re taking the get-content command to pull data from a local text file “computers.txt” into a data object and then iterating through it sequentially.  We are then using the computer name as the lookup name with the get-adcomputer cmdlet along with all it’s ad properties and assign it to a variable called ado.

Now we create a PowerShell object and begin to give it some noteproperties with values pulled from our ad object we created from the ad cmdlet then echo it’s contents out by calling it.

When we run the script and pipe it’s output to export-csv –NoTypeInformation we are taking that output and putting it directly into a csv without any of the object information, otherwise it’s a tabled console output.

PowerShell is so boss sometimes…

Maybe we just do all this in one line?

gc computers.txt|ForEach-object{Get-ADComputer $_ -properties *|select -Property name,operatingsystem,operatingsystemservicepack}|export-csv -notypeinformation output.csv

Scroll that line, like a boss.

Gallery entry on Script Center if you want to rate it

So my free time has been spent lately helping with 2 children with walking pneumonia, 1 infant (perfectly healthy) working a full time job with more than a full time workload; and a lot of the cool, fun stuff I’m doing at work (in my opinion anyway)…. I can’t talk about here

.:: sadface ::.

(I still think my wife has been working harder than I have)

Trick or treating was fun, both Will and Maggie had a blast at their last Trunk or Treat @ HSBC, and run around their neighborhood.  Will was all go, all night; and Maggie was super fired up about her candy!  I was exhausted afterwards of course, but I was overjoyed to see their excitement!  Glad I got to TC this week.

As far as my gaming; I’ve been able to play a little bit of Borderlands 2 (not even 20 yet), and Torchlight 2 (wiped out my save so had to start over) which I have enjoyed.  AC3 was released, and Halo 4 is coming next Tuesday.  Alas, my consoles are packed for the move so I won’t be getting/playing them right away which pains me a bit.  I’d get AC3 for PC, but I have already played all the others on my PS3, so I wish to maintain that trend.

And for coding; I’ve been doing a fair amount of (windows) scripting lately, but nothing really ground breaking.  I did write a SQL to email script in both vbscript then re-wrote in PowerShell (since I was informed CDO will be depreciated in future releases of exchange) which I plan on sharing here in another post once I’ve scrubbed them.  They are actually jokingly easy to do, but very useful for anyone that hasn’t got a paid tool for this kind of thing.

In the short term I’m going to share a simple script to quickly gather OS service pack information from AD from a list of machines and dump it to a csv I wrote for a buddy of mine (seriously, in PowerShell this is crazy simple).

Expect to see that post around Monday or Tuesday; until then, have a good one and pray for us (or keep us in your thoughts).  There’s a lot going on, and we all feel a bit overwhelmed.