header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left
Random Cmdlets
Set-PublicFolderDatabase
Use the Set-PublicFolderDatabase cmdlet to set attributes of public folder databases.


Remove-ManagedFolder
Use the Remove-ManagedFolder cmdlet to delete managed folders from the Active Directory directory service.


Get-DistributionGroup
Use the Get-DistributionGroup cmdlet to query for existing distribution groups.


Ping-Host
Sends ICMP echo requests to network hosts.


Get-PEHeader
Gets the Portable Header information from an executable file.


Remove-IPBlockListProvider
Use the Remove-IPBlockListProvider cmdlet to remove the configuration information for a specific IP Block List provider configuration on a computer that has the Edge Transport server role or the Hub Transport server role installed.


Export-SDMgpo
Backs up a GPO to a given file location


Disable-Mailbox
Use the Disable-Mailbox cmdlet to disable the mailbox of an existing user or InetOrgPerson and remove that object's Exchange attributes from the Active Directory directory service.


Stop-Process
Stops one or more running processes.


Test-WebServicesConnectivity
The Test-WebServicesConnectivity cmdlet performs basic operations to verify the functionality of Outlook Anywhere on a Microsoft Exchange Server 2007 computer that has the Client Access server role installed.


  
Latest Scripts from PoshCode.org

Exch07 Quota Report
Power Shell 1 script used to grab mailbox stats for a Exchange 2007 server. It saves the information into a .csv file by changing the $OUTFILE variable. The script is pretty basic but it's a simple way of having a history of how people use their inbox space. There is no method for managing the saved files. I just make it a point to delete them when I run my months end maintenance.

Out-DataTable
Creates a DataTable for an object, based on script by Marc van Orsouw

Modified WOL impl.
This function can send WOL packages. Note that this a modified version of code already floating online. You need to specify the Mac address as a string. Optionally use -Ports (0,1000) to specify the udp ports. (use -verbose to show which pacakges are being send).

Invoke-SqlCmd2
Modeled after SQL Server 2008 Invoke-Sqlcmd, but fixes bug in QueryTimeout.

EchoTest.cmd
A DOS cmd script to show how your arguments look to "native" console apps

Set account password
This script will allow you to set the password for an account on a local or remote machine/s. A report is then generated when done along with an error log. Scripts accepts pipeling input for the computer/s. If any errors are encountered, a log will be generated as well.

Enable/Disable FusionLog
http://georgemauer.net/blog/enabledisable-fusionlog-powershell-script/ Enabling/disabling your Fusion Log every time you need to figure out why assembly binding has gone wrong is a hassle. So here you go.

Start-Presentation
My current (WPF 4 compatible) PowerBoots-based Presentation Module. *REQUIRES* "PresentationFrame.xaml":http://poshcode.org/get/2104 and, of course, "PowerBoots":http://boots.codeplex.com This isn't really ready to be shared, but I always tell people if you wait until after you have time to clean it up, you'll never share it -- so since I'm unlikely to actually finish cleaning this up any time soon -- here it is. "See the screenshots for an example":http://HuddledMasses.org/images/PowerBoots/PowerBoots%2dPresentation.png

PresentationFrame.xaml
A required file for my "PowerShell Presentation module":http://poshcode.org/2105

Get-RemoteRegistry
A script to do a query on a remote registry key or value. Because the Registry provider inexplicably doesn't support it.
  
 

April 5th, 2010,

The 2010 Scripting Games are coming...

2010 Scripting Games

 Fire up your scripting editor and get ready to write some PowerShell!

Check out the Study Guide and register for the games!

-Steven Murawski
Co-Community Director

Community News
iPowerShell V2 Now Available

Sapien just released iPowerShell V2, which is now available in the Apple app store.  What is iPowerShell?

From Ferdinand Rios -

PowerShell In Practice

From Marco Shaw -

Check out http://www.manning.com/siddaway

Get the ebook or printed edition (not available yet), and use the discount code "marcoshell40" when checking out and get 40% off the regular...

Thomas Lee Joins PoshComm Directors

PowerShellCommunity.Org is happy to announce that Thomas Lee, Powershell MVP and noted trainer, is joining our ranks as a Community Director. 

Thomas is also responsible for a good many of the PowerShell...

Looking to get started with Modules?

Check out the PowerShellPack from James Brundage, which contains modules for making GUI's, add-ons for the ISE(Integrated Script Editor), system tools, and...

PowerShell Virtual Launch Party

PowerShell V2 Virtual Launch Party!

Jeffrey Snover, Hal Rottenberg and Jonathan Walz (hosts of the PowerScripting Podcast) hosted a PowerShell V2 Virtual Launch Party on Thursday, Oct 22nd, 9:30 PM EDT (GMT-4). 

More details...

  
Recent Blog Entries
Jun 17

Written by: Karl Prosser
6/17/2008 9:12 PM

Given the context on the last few posts. I've made a simple helper method in C# that can take a simple powershell hashtable and create a PSCustomObject based on it. Here is an example of how you can call it.

[snapinini.newobjecthelper]::newObjectFast(@{name="karl";age=31;now = [datetime]::Now})

very simple and its at least 6 times faster than the closest other technique in powershell. Most of hte overhead is in creating the hashtable. (otherwise its 90 times faster). The hashtable syntax is very convenient however maybe even its overhead is too much and we deserve a better way.

Here is the C# method. Its pretty basic stuff.

 

public static PSObject newObjectFast( Hashtable noteproperties )
{
PSObject obj = new PSObject();
if (noteproperties != null)
foreach(DictionaryEntry item in noteproperties)
obj.Properties.Add(new PSNoteProperty((string)item.Key,item.Value));
return obj;
}

- Karl

Tags:

Your name:
Title:
Comment:
Add Comment    Cancel  
  

We have a new sponsor!  Introducting Pragma Systems.  See the home page for details.

right
   
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 footer
footer