Showing posts with label SMS. Show all posts
Showing posts with label SMS. Show all posts

Wednesday, February 13, 2008

Code Snippet plugin for Windows Live Writer

Update: It actually tested this layout on my test blog, but formatting is definitely not the same: On msgoodies, only the example without alternating and without container is pretty. I will look into this and do another update.

Thank you Leo Vildosola! You just made me a very happy blogger :)

I found his plugin for Windows Live Writer and it works great with PowerShell scripts (as well as Blogger). Inserting well-formatted, color-coded PowerShell code is now as easy as selecting 'Insert Code Snippet', pasting the code and pressing ok (and can even be easier, see the end of this entry). There are only two drawbacks -

  1. It is not copy-friendly (see below), as there are no line breaks. But my current method does not have that either
  2. The formatting is called MSH and not PowerShell, but I think I can live with that ;)

If you choose a layout with either line numbers or alternate formatting, it becomes copy-friendly.

Some examples

With line numbers and a container (not copy-friendly)

   1: # Set-SMSCacheSize


   2: param([int]$newSizeInMB=2000)


   3:  


   4: $sms=new-object -com UIResource.UIResourceMgr


   5: $ci=$sms.GetCacheInfo()


   6: if ($ci.TotalSize -ne $newSizeInMB) {


   7:     $ci.TotalSize=$newSizeInMB


   8:     "Size set to $newSizeInMB"


   9: }


  10: else {


  11:     "Size $newSizeInMB already correct"


  12: }






Alternating lines, no container, no line numbers (copy-friendly)





# Set-SMSCacheSize


param([int]$newSizeInMB=2000)


 


$sms=new-object -com UIResource.UIResourceMgr


$ci=$sms.GetCacheInfo()


if ($ci.TotalSize -ne $newSizeInMB) {


    $ci.TotalSize=$newSizeInMB


    "Size set to $newSizeInMB"


}


else {


    "Size $newSizeInMB already correct"


}







No line numbers, no container (not copy-friendly)




# Set-SMSCacheSize
param([int]$newSizeInMB=2000)

$sms=new-object -com UIResource.UIResourceMgr
$ci=$sms.GetCacheInfo()
if ($ci.TotalSize -ne $newSizeInMB) {
$ci.TotalSize=$newSizeInMB
"Size set to $newSizeInMB"
}
else {
"Size $newSizeInMB already correct"
}






No line numbers, no container, alternating lines (copy-friendly)





# Set-SMSCacheSize


param([int]$newSizeInMB=2000)


 


$sms=new-object -com UIResource.UIResourceMgr


$ci=$sms.GetCacheInfo()


if ($ci.TotalSize -ne $newSizeInMB) {


    $ci.TotalSize=$newSizeInMB


    "Size set to $newSizeInMB"


}


else {


    "Size $newSizeInMB already correct"


}







No line numbers, container, alternating lines (copy-friendly)





# Set-SMSCacheSize


param([int]$newSizeInMB=2000)


 


$sms=new-object -com UIResource.UIResourceMgr


$ci=$sms.GetCacheInfo()


if ($ci.TotalSize -ne $newSizeInMB) {


    $ci.TotalSize=$newSizeInMB


    "Size set to $newSizeInMB"


}


else {


    "Size $newSizeInMB already correct"


}






In the future, I'll probably stick with the no container, alternating lines style, although I would be glad to get rid of the alternation. I do not like how the container behaves when the browser is resized - YMMV.



BTW: It seems like the copy-friendliness is depending upon whether the generated HTML contains a single <pre> or multiple ones. Alternating lines and line-numbers uses a <pre> per line; without, a single <pre> is used.



Silent Mode



The plugin has another smart feature. You can enable silent mode. With silent mode, your clipboard is inserted with the lastest settings, just by clicking the 'Insert Code Snippet'. If you want to disable silent mode and do something else, simply ctrl-click the link. This is a great productivity feature.

Thursday, May 24, 2007

System Center Configuration Manager 2007 Beta 2 Product Feature Quizzes

Here is an alternative way of learning the new features of SCCM 2007.

The System Center Configuration Manager 2007 User Assistance team has created a set of 7 quizzes to help you assess your understanding of the dependencies and requirements for key features of Configuration Manager. These quizzes are intended to raise your level of awareness of the some of the nuances of these features before you configure and use them. They can also be used to help train other Configuration Manager administrators within your organization. Each quiz contains 10 or more questions that can be answered Yes or No. Regardless of your answer, the quiz will display the correct information, and include one or more links to the corresponding related content located on TechNet.

Wednesday, March 21, 2007

Digging old knowledge out of the head

Stupid me!

I used to end my emails with this quote -

There is only one thing more painful than learning from experience and that is not learning from experience.

-- Archibald McLeish (1892–1982), American poet

I just learned it the painful way. I had the experience, but it was burried too deep.

I was happily deploying software to our servers with SMS. I normally just push things out, but this time I wanted to install the program manually the first couple of times as it was Windows Server 2003 SP2. Well, I jumped in Add/Remove Programs, clicked Add New Programs and - nothing!

Strange!

I gave policyspy a go. Everything looked fine. I checked eventlog, status messages in SMS etc. Everything looked fine.

But on a few of my servers I could in fact see the expected advertisements.

Then I (finally) realized: If you connect to a computer with Remote Desktop and not to the console of that computer, SMS has a nasty bug and is not able to show advertisements in ARP or interact with the desktop.

Stupid bug. And stupid me for forgetting it.

Sunday, June 11, 2006

Windows Vista beta 2 testing

Just got a brand new Dell Latitude D820 with the necessary power to run Vista including Aero (NVIDIA GeForce Go 7400/Quadro NVS 120M). The aim is to use it for testing Vista and Office 2007 and to automate the installation, so I can rebuilt it with SMS whenever Vista, Office or the drivers get updated.

My first major obstacle was to get a grahics driver - the NVidia Forceware beta 88.61 did not recognize my hardware (even though the claim it is a universal driver).

Well today I browser the Dell forums and found this thread which linked be to the Nicke Anderson blog and finally it ended up at Laptop Video 2 Go, which have a modded nv_disp.inf that did the job. I included all the steps in my search, so you can get all the details yourself.

After installing the driver with the modded .inf, I just had to adjust the display resolution (1920x1200 nice!) and select the Aero color scheme.

So, now I'll continue my tests...

Friday, March 17, 2006

Microsoft Connect and SMS 4 Beta

Wanted to join the SMS 4 Beta program - and consequently got into a new (for me at least) site called Microsoft Connect. Connect is a kind of new betaplace. Browsing the available programs page, I found another interesting product called Certificate Lifecycle Manager Beta 1. You can check it out yourself - I will when I have a little time to spare.

Monday, October 03, 2005

Setting SMS 2003 Cache Tombstone Duration

If you are downloading before running a lot in SMS - i.e. making SMS copy the package down to its cache before running the program - you may have come across the problem that the cache is full, even though all your programs have finished and you'd expected that it had freed the cache entries.
Well, SMS keeps the cache entries around for at least a day - just in case you need it again, I guess. In normal circumstances, that could be ok, but if you are installing a fresh PC with a lot of packages, this cache strategy can get you in space problems.
Microsoft writes about it in KB 839513 - How the Systems Management Server 2003 Advanced Client manages its cache. Microsoft states that the cache tombstone duration is 24 hours.

Microsoft draws you attention to the SDK, especially the CacheInfo object. But this object only allows you to read the tombstone duration.
What they do not mention, is that you can simply tweak the cache tombstone duration, so the problem is gone or at least highly reduced. You do that by creating a MOF file - say SetCacheTombstoneDuration.mof - with these lines (sorry about the tiny font - I try to prevent the lines from wrapping)
#pragma namespace("\\\\.\\root\\ccm\\policy\\machine\\requestedconfig") [CCM_Policy_PartialPolicy(true)]
instance of CCM_SoftwareDistributionClientConfig
{
SiteSettingsKey = 1;
// Override only this property,

// all others come from the Site/Management Point
PolicySource = "Local";
// 5 min, default 86400 - one day
[CCM_Policy_Override(true)] CacheTombstoneContentMinDuration = 300;
};

Send the program to the relevant clients and execute it with -
mofcomp SetCacheTombstoneDuration.mof

That is all these is to it.

I cannot see that this method give any side-effects - but I also cannot guarantee it. If you experience any problems, please feel free to share your experience as comments to this entry.

Wednesday, August 03, 2005

SMS 2003 SP2 Beta starts

Vacation done...

Just got the invitation to join i.e. nominate myself. It is going to be interesting to see if they drop in new features just like they did for SP1 and in that case what they will improve.

Monday, July 04, 2005

The hunt for non-PC SMS programs (SMS 2003 SDK v3)

Having created an SMS script late yesterday, setting the MOM flag on the programs for one of my customers, he came back and told me, he had to do an SMS restore as it trashed the image packages.
Bad, bad.

Ok, I said to myself. I'll just modify the program to skip those image package programs - and exclude any device management programs as well.
But this was easier than done. First of all, I'm at Tech-Ed in Amsterdam with my fellow blogger Dennis. Secondly, the battery of my Dell is bad and finding power for charging is difficult here at the RAI.

Having come across all those obstacles, I went on...

First I stumbled across v3 of the SMS SDK. It was released June 21st. Get it from MS downloads. This is a must-have for all doing SMS automation. The official voice says: New for the SMS V3 SDK is a .NET server side library which simplifies access to the SMS WMI site provider, and Device Management inventory extensibility information.

So I looked to the program flags and found that bit 9 indicates a device program. But how do I see, that the program is an OS installation?

That it NOT documented.

Found it myself though. The SMS_Package class has an ImageFlags property. It seems to be zero - remember this is undocumented and at your own risk - for normal packages.

So I redid my script and can now first filter away the image packages and then the device programs.

I hope my customer does not have to do a new restore tomorrow...

Wednesday, April 20, 2005

SMS and MOM are NOT going to merge

New directions for System Center! System Center is now a brand for number of products. Read it from the horse's mouth from the MMS press room. Or from the WinInfo Daily UPDATE. You can find it on the net here, and I just realized, that I can get it as RSS feed instead of by email.

Wednesday, April 06, 2005

Using a custom view from an SMS report

This is possible to create you own custom view in SQL and use it in an SMS report. Just did it. Could not find any info on it, so the method might be unsupported. This is how you do it -
  • Create the view in the SQL Database (SMS_sitecode)
  • Use a name that does not conflict with existing or future names and that follows the SMS conventions. E.g. v_MyCompany_name
  • From the view permission, enable select access to the webreport_approle
In the SMS report SQL you can now reference the view. Note that it does not appear in the list. I do not know how that can be done. Also beware of any security side-effects. Depending on what you do in the view, you may be able to bypass the SMS security so the report user could get access to data he/she should not see.
This is completely unsupported, so the risk is on you!

Friday, April 01, 2005

SMS Scripting Guide

Was released the other day. Get it from MS Downloads. Contains some very good examples. One I found particular useful was the Status Filter Rule example. Add it to your scripting arsenal.

Tuesday, March 01, 2005

Software Updates for Dell Server Hardware Using SMS 2003

On MS Downloads.
This solution accelerator helps SMS administrators effectively and efficiently deploy software updates for Dell server hardware using Systems Management Server (SMS) 2003 and the SMS 2003 Inventory Tool for Dell Updates.

Friday, February 25, 2005

New Permission Objects in SMS 2003 SP1.

While creating a script setting up permissions in SMS, I realized that there are some a new kids in town – the manage folder permission and the software updates class. But the binary value of those are not documented in the SDK!

Manage folder is bit 17 hex 0x20000 decimal 131072. Software Updates is class value 10. Both are the next available bit/value - makes sense.

Software Updates has read, modify, delete, administer, create and delegate permissions.

Sunday, February 06, 2005

SMS 2003 SDK Version 2

V2 was out in August last year so this is not brand new stuff. Anyway, things like these may not be the first to look at until you have a reason, so treat this as a reminder. The new version contains .NET examples, console folder documentation and the Management Point (MP) API. As always it contains a wealth of information useful for the SMS nerd :) - the extensibility of SMS is one of its best features.

Thursday, January 27, 2005

How to Run a WMI Query from the Command Line

If you have some WMI Query you can use wbemtest *) to run it. But this is a little tedious as you first have to connect to the namespace etc.
An alternative is to do it from the command line using WMIC. Take this statement - it was part of an SMS error message I got:
SELECT __CLASS, __PATH, __RELPATH, Description, Manufacturer, Name, Status FROM Win32_NetworkClient
You can not use the statement directly, but it can easily be converted to WMIC style:
wmic path Win32_NetworkClient get __CLASS, __PATH, __RELPATH, Description, Manufacturer, Name, Status
Use the /Format switch to make the output more readable.

*) In case you do not know wbemtest, play around with it. Just search the Help and Support Center for wbemtest.

Saturday, December 04, 2004

msgoodies - not an experimental blog anymore

We've been blogging for approx. 2 months now and have found it to be really fun to share some of our knowledge and experiences that we've until now only have shared with our customers and internally (and a bit in newsgroups).
We've already been mentioned on the MS Exchange blog (Thanks Chris ;-) and also our favorite MS bloggers at You Had Me At EHLO... has created a link to our blog (Check the front page under "Other Exchange Blogs") - so now we have decided to remove the "experimental" word from our about box, 'cause Per and I have decided to continue posting and enhancing the content and features of this blog.
Personally I'm finally back from my paternity leave (See my daughter Ida here) and will be back with more info on Exchange, IMF and ISA and updates to some of the topics I've been posting earlier (use our Atom Site Feed for subscription to new/updated posts) .
Per will continue to cover his main areas - from security, networking, AD over to management (MOM 2005 and SMS 2003).

Friday, November 26, 2004

Improvements in Management of Dells

Seems like our job got a little easier.

Microsoft and Dell reports that Dell will deliver management software working with the Dynamic Systems Initiative (DSI) (what we in the real world call SMS and MOM). Read more at Dell Unites with Microsoft to Provide Better Management Solutions and at Dell, Microsoft make a patch pact for servers

Tuesday, October 12, 2004

SMS 2003 OSD Feature Pack RC and SP1

The SMS 2003 OS Deployment feature pack that provides the capabilibity of distributing new OS'es through SMS 2003 has now been released to the web in a Release candidate version. Furthermore SP1 for SMS 2003 has also been released in German and Japanes versions - checkout the new capabilities of SP1 here.

Tuesday, October 05, 2004

SMS 2003 Software Updates to Support Uninstall (KB885438 and KB885266)

After getting used to SUS with less than optimal reporting capabilities it was a relief to see that some of the issues with SUS was solved with the Software Update management capabilities of SMS 2003 (Making it applicable for enterprise customers). With Windows Installer 3.0 technology then came the possibility of completely uninstalling patches and now there's an update out there to support uninstalling patches deployed with SMS 2003. Of course at most times this shouldn't be necessary with the right amount of testing - but one newer knows what kinds of ravage a innocent looking hotfix can do to older production systems (Not speaking from experience of course ;-)