Win7 Themes and Screensaver

If you want to enforce users to use a specific screensaver you can do most of it via standard group policies. But if you run Windows 7 and a user changes the current theme… the screensaver will be blank until the next group policy refresh.
This is due to that the default .theme-files have no screensaver defined.

With Group Policy Preferences you can change this…

First we need to change the current ACL on the themes directories since SYSTEM cant write there.

Edit or create a Group Policy.
Browse to Computer Configuration – Windows Settings – Security Settings – File System
Right Click and select Add File… then write %SystemRoot%\Resources\Themes in the Folder-box.
Set the security rights as you want them, but remember to give SYSTEM the rights to Modify.
In the dialog “Add Object” that pops up when you press OK, select Replace existing permissions on all suboflders and files with inheritable permissions, this option is not selected as a default.
Repeat that for %SystemRoot%\Resources\Ease of Access Themes directory.

Then browse to Computer Configuration – Preferences – Windows Settings – Ini Files
Right Click and select New – Ini File
Give the following options:

(I would recommend that you set a item level targeting to check that the file exist)

Now to the boring part, repeat that for all Theme-files in the directories %SystemRoot%\Resources\Themes and %SystemRoot%\Resources\Ease of Access Themes

If there is something else you want to change you can find loads of options for themes in this reference http://msdn.microsoft.com/en-us/library/bb773190%28v=vs.85%29.aspx


No more secrets…???

After almost 10 years (3 weeks short) at Atea Sweden I’m now leaving the company for an employment on the customer side.
Since I’m not working at a consultant company that sells the kind of solutions I’m blogging about… I have no “restrictions” on what I can blog about.

Hope that I can share more of my scripts, findings and solutions instead of keeping them as a “company secret”.

No more secrets! :-)

On the one hand information wants to be expensive, because it’s so valuable. The right information in the right place just changes your life. On the other hand, information wants to be free, because the cost of getting it out is getting lower and lower all the time. So you have these two fighting against each other.

Thoughtful quote by Stewart Brand at the first Hackers’ Conference back in 1984


Demo Webservice

A while ago I wrote a little PHP-application for demostrating webmonitors in System Center Operations Manager 2007.
It will probably work for any monitoring solution that catches http errorcodes or textstrings on a page.

Free to use, so give it a try. :-)

You can find it at: https://snowland.se/demo/


Federated Search of snowland.se

Windows 7 have a cool feature that uses opensearch…
It gives you the ability to search webservices (and whatever that responds with XML). So after some lines of code here is a osdx-file that you can add to your Windows 7 installation.

snowland.osdx

091001_federatedsearch


Pimp my PXE-boot screen

It was “a few” years ago since I did use a HEX-editor… but with a little time over last night I did a small hack to the PXE-boot files.

Why I did it…
1. I wanted to test if I still know how to use a HEX-editor
2. I don’t like the original text.

Do I need to mention: This is NOT supported by anyone and if you break any deployment-solution… don’t blame me.

First, make a backup (*doh*).

The files you are looking for are located on your PXE-point, X:\RemoteInstall\SMSBoot\x86 (and \x64)

I use XVI32 v2.51 www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm to make the changes in the binary files.

Open up PXEBOOT.COM in XVI and search for “Press F12″ (case sensitive).
Then replace the text. If you have a shorter text, fill it out with blank spaces. If you have a longer text… tough luck. :-\

"Press F12 for network service boot"
"Press F12 for snowland deployment "
 

The original text:
hexedit-press-f12

And the changed text:
hexedit-press-f12-snowland

Save and test to PXE-boot a machine.
(If you can’t see the new text, you probably need to copy the changed file to both the x86 and the x64 directory)

That wasn’t to hard, was it?
If it was… don’t bother to try the WDSNBP.COM-file. :-P

The largest textblock that a user can see is the following text, this is what we want to change / pimp.

The details below show the information relating to the PXE boot request for
This computer. Please provide these details to your Windows Deployment Services
Administrator so that this request can be approved.
         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
 

The easy way is just to change the text to something else, but why not use some ascii-art?

If you want to use ascii-art, the maximum width is 51 chars (the width of the third line) and 3 lines high since you need to replace and not add/delete anything.
Of course the first and second line can be a bit longer.

So… start up some texteditor with monospace font (notepad will do) and create some ascii-art.

   __  _  _  __  _    _ _    __  _  _ __
  (__  |\ | |  | |    | |   |__| |\ | |  \  Deployment Services is loading…
  .__) | \| |__|  \/\/  |__ |  | | \| |__/
         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
 

Now that we have some ascii-art with loads of blank spaces we need to replace the right number of spaces with something that we can see.

###__##_##_##__##_####_#_####__##_##_#__###################################
##(__##|\#|#|##|#|####|#|###|__|#|\#|#|##\##Deployment#Services#is#loading…##
##.__)#|#\|#|__|##\/\/##|__#|##|#|#\|#|__/#########
         1         2         3         4         5         6         7         8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
 

The number of # should be exactly the same as the original text.

Start up XVI32 and load WDSNBP.COM, search for “The details below”… now comes the boring/tricky part. Replace the original text with your new ascii-art.

I did a small “translation”-file where I have the orignal row and the new row next to each other, like this for the second row.

This computer. Please provide these defails to your Windows Deployment Services
##(__##|\#|#|##|#|####|#|###|__|#|\#|#|##\##Deployment#Services#is#loading…##
 

Now you can see that the text “computer.” sould be replaced to ” |\ | | “. Yes, it will be hard to read and easy to do wrong.

There is a search/replace option in XVI32, if you use it remember: replace with the exact same number of characters.

Save, PXE-boot and enjoy… :-)

The original:
f12-orginal

The final result:
f12-snowland

The MD5-hash of the WDSNBP.COM and PXEBOOT.COM-files in both x86 and x64 directories is the same so you only have to make the changes in one of them.
wdsnbp-md5-hash


Count files in SCCM-inboxes – Version 2

A bit more complex version of the last script…

Requires a parameter for servername.

inboxcount.vbs

Option Explicit
Const cMinNofFiles = 1

Dim oFso, oArgs
Dim sPartOfPath, sServername, sSiteCode
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oArgs = WScript.Arguments

If oArgs.Count < 1 Then
        WScript.echo "ERROR: Missing argument!"
        WScript.Echo ""
        WScript.Echo "cscript.exe inboxCount.vbs SERVERNAME "
        WScript.Quit -1
End If
sServername = uCase(oArgs.Item(0))
If oArgs.Count-1 = 1 Then
        sPartOfPath = oArgs.Item(1)
Else
        sPartOfPath = ""
End If

sSiteCode = getSccmSiteCode(sServername)

WScript.Echo "=============================================================================="
WScript.Echo " SCCM Inbox Counter                            Rikard Ronnkvist / snowland.se"
WScript.Echo "------------------------------------------------------------------------------"
WScript.Echo "   Server: " & sServerName
WScript.Echo " SiteCode: " & sSiteCode
WScript.Echo "     Path: \\" & sServername & "\SMS_" & sSiteCode & "\inboxes"
WScript.Echo "------------------------------------------------------------------------------"
ListFolders "\\" & sServername & "\SMS_" & sSiteCode & "\inboxes", "\\" & sServername & "\SMS_" & sSiteCode & "\inboxes"
WScript.Echo "=============================================================================="

WScript.Quit

Function getSccmSiteCode(sServername)
        Dim oWMIService, oLocator, oSites, currentSite

        Set oLocator = CreateObject("WbemScripting.SWbemLocator")
        Set oWMIService = oLocator.ConnectServer(sServername, "root\sms", "", "")

        ' Now figure out the site code for this server.
        Set oSites = oWMIService.ExecQuery("SELECT SiteCode FROM SMS_ProviderLocation WHERE ProviderForLocalSite=true")

    For each currentSite in oSites
        getSccmSiteCode = Trim(currentSite.SiteCode)
        Exit Function
    Next
End Function

Sub ListFolders(sPath, sRoot)
        Dim oFolder, oFldr
        Set oFolder = oFSO.GetFolder(sPath)
        If (oFolder.Files.Count >= cMinNofFiles) AND (InStr(oFolder.Path, sPartOfPath) > 0) Then
                wscript.echo Left(oFolder.Files.Count & "        ", 6) & vbTab & Replace(uCase(oFolder.Path), uCase(sRoot), "")
        End If

        For Each oFldr In oFolder.SubFolders
                ListFolders oFldr.Path, sRoot
        Next
End Sub

Microsoft to forbidd virtualization?

On a not-so-serious side… MSTV where at Banverket (where I do some consultant work) a while ago and shot a film for a case study…
The ending isn’t the best for Microsoft Sweden.

Forbidden = “Förbjudet” in swedish.

Source: http://www.microsoft.com/Virtualization/casestudy-banverketict.mspx


Xian Network Manager Io Certified Engineer


Woohoo… So today myself (and a some of my co-workers) are “Xian Network Manager Io Certified Engineer” :-)

More info on the product: www.jalasoft.com


FYI: On the move…

snowland.se is on the move.

I am changing webhost for snowland.se so if you get som 404 or any other error… you know why.

Why the change? I’m collecting all my domains to one host.

Changing to Surftown


snowland.se v2.0

Ok som ni kanske ser så har siten bytt tema och om någon rad även språk.

Announcing snowland v2.0
- Change of this site from swedish to english
- New theme
- Some small updates (mainly bug’s)

To-do-list
- Translate the static pages

Might-do-list
- Translate the older posts


Next Page »