January 2009 - Posts

Interesting point. I still like ISA Server better though, but that’s me.

ISA Behind a Cisco ASA? « Richard Hicks’ ISA/TMG Blog

Posted by Richard | with no comments
Filed under:

What if your CSV file doesn’t have headers? well Powershell makes that pretty easy too. Essentially you have to read in the text then split the text into the separate columns.

$users=@();
get-content test.csv | foreach-object {$users+=,($_.split(“,”));};

 

Once that command is done your $users variable will have each field in your CSV into a separate array element. Then you can do something like $users[0][0] to get the first item in the first row or $users[-1][-1] to get the last item in the last row.

Here is a related blog post on arrays

http://blogs.msdn.com/powershell/archive/2007/01/23/array-literals-in-powershell.aspx

Posted by Richard | with no comments
Filed under: ,

Importing a CSV file will allow you to work with it as though it were an object. Here is an example

get-process

get-process | export-csv process.csv

$process = import-csv process.csv

$process

$process | format-table

$process | where-object {$_.vm -gt 100000}

| Format-Table

 

Once imported the rows of the csv file become the objects you can manipulate. The column headings become the properties.

Posted by Richard | with no comments
Filed under: ,

Let’s get these people working too.

Stimulus: Hard hats say 'bring it on' - U.S. business- msnbc.com

Posted by Richard | with no comments
Filed under:

I have one question about this. I am all for fiscal responsibility, but how to you get things paid if people are not working? How do you give tax cuts to someone who is not paying any?

Let people get working first then give a cut that is fair when bills are paid. But that is me.

Obama recovery plan advances in Congress - Economy in Turmoil- msnbc.com

Posted by Richard | with no comments
Filed under:

 

Windows PowerShell: Working with Active Directory

One thing I will say here. I was teaching a class and I had a brain fart. I couldn’t for the life of me remember how to add users to groups. Well one little nuance to the above script is adding multiple users requires you to do an assignment first. You do it in one of these two ways.

 

Method 1

$group=[adsi]”LDAP://path”;

foreach-object ($user in $userarray)
{
     $user;

     $null=$group.member.add($user);

}

$group.psbase.commitchanges();

or in this method we use the pipeline instead, however you have to assign it to a variable first.

 

Method 2

$group=[adsi]”LDAP://path”;

$userarray | foreach-object
{
     $user=$_;

     $user;

     $null=$group.member.add($user);

}

$group.psbase.commitchanges();

 

When it comes to working with PowerShell and ADSI, it is important to refer back to these two blog posts.

http://blogs.technet.com/benp/archive/2007/03/05/benp-s-basic-guide-to-managing-active-directory-objects-with-powershell.aspx

and

These that are related

http://pathologicalscripter.wordpress.com/2006/09/28/invisible-methods-for-adsi/

http://blogs.msdn.com/arulk/archive/2006/07/25/678137.aspx

http://blogs.msdn.com/arulk/archive/2006/07/28/682289.aspx

http://blogs.msdn.com/arulk/archive/2006/08/24/719241.aspx

 

And when needing a reference to set values, here is the guide that showed which interface and what are the right fields in active directory.

http://msdn.microsoft.com/en-us/ms677286.aspx

Posted by Richard | with no comments

This will work in powerShell as well. So you can install local printers using this interface. I have not tried it with Vista or Server 2008 but it seems like it is exactly what you need if you want to automate install of local printer.

Install Printers using Batch Files

Posted by Richard | with no comments

Here are some samples of how you can add a network printer to a machine through WMI.

http://www.fpschultze.de/smartfaq+faq.faqid+263.htm

Adding network shared printer

Posted by Richard | with no comments
Filed under: ,

Another example of using Powershell in ASP.NET.  With this example there is more information on a simple page to test this.

www.leastprivilege.com - Hosting PowerShell in ASP.NET

Posted by Richard | with no comments
Filed under: ,

If you want to put powershell into your applications or into ASP.NET then here is a sample of how you could host it within your site.

Windows PowerShell Blog : Impersonation and Hosting PowerShell

Posted by Richard | with no comments
Filed under: ,

These are some neat features.

Interesting joke about the Siamese fighting fish. Not sure if that is the only joke, but this is the one I got out of it.

Tim Sneath : The Bumper List of Windows 7 Secrets

Posted by Richard | with no comments

Now this is funny… I loved the W.T.F. (W., Thanks and Farewell) episode.

 

Posted by Richard | with no comments
Filed under: ,

 

Posted by Richard | with no comments
Filed under:

 

Posted by Richard | with no comments
Filed under: ,

I guess I could make this a series huh? :-)

 

Here are some further documentation around performance guidance and deployment at large global environments. Most of the information below is based on Microsoft’s internal deployment layout. Some of the links refer to the SPS 2003 installation, but many of the structures

This is information from the “how Microsoft does IT” site.

http://technet.microsoft.com/en-us/library/bb687797.aspx

http://technet.microsoft.com/en-us/library/bb735172.aspx

http://technet.microsoft.com/en-us/library/bb735255.aspx

http://technet.microsoft.com/en-us/library/cc964305.aspx

http://technet.microsoft.com/en-us/library/bb735257.aspx

http://technet.microsoft.com/en-us/library/bb735245.aspx

http://channel9.msdn.com/Showpost.aspx?postid=291986

Here is further information on deploying MOSS in a global scenario

http://blogs.msdn.com/joelo/archive/2006/12/21/determining-the-global-deployment-approach.aspx

http://blogs.msdn.com/sharepoint/archive/2008/02/04/sharepoint-global-deployment-guidance.aspx

http://technet.microsoft.com/en-us/library/bb735245.aspx

Here is information around the database maintenance plans and performance improvements

http://technet.microsoft.com/en-us/library/cc825329.aspx

http://technet.microsoft.com/en-us/library/cc262731.aspx

http://blogs.msdn.com/sharepoint/archive/2008/02/28/database-maintenance-for-sharepoint-whitepaper.aspx

Posted by Richard | with no comments
Filed under: ,
More Posts Next page »