Strict Standards: Redefining already defined constructor for class wpdb in /var/www/myfoto.se/jbits.se/blog/wp-includes/wp-db.php on line 56

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-includes/cache.php on line 36

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /var/www/myfoto.se/jbits.se/blog/wp-includes/cache.php on line 384

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 541

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 560

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 659

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el($output) in /var/www/myfoto.se/jbits.se/blog/wp-includes/classes.php on line 684

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/code-highlighter/codehighlighter.php on line 42
jbits.se http://jbits.se/blog Jörgen Björkmans blog Thu, 27 Oct 2011 09:39:28 +0000 http://backend.userland.com/rss092 en Powershell DFS Replication Check Run this script on a dfsr-member to check status of all dfs replications.  $RGroups = Get-WmiObject -Namespace "root\MicrosoftDFS" -Query "SELECT * FROM DfsrReplicationGroupConfig" $ComputerName=$env:ComputerName $Succ=0 $Warn=0 $Err=0 foreach ($Group in $RGroups) { $RGFoldersWMIQ = "SELECT * FROM DfsrReplicatedFolderConfig WHERE ReplicationGroupGUID='" + $Group.ReplicationGroupGUID + "'" $RGFolders = Get-WmiObject -Namespace "root\MicrosoftDFS" -Query  $RGFoldersWMIQ $RGConnectionsWMIQ = "SELECT * FROM DfsrConnectionConfig WHERE ReplicationGroupGUID='"+ $Group.ReplicationGroupGUID ... http://jbits.se/blog/2011/09/15/powershell-dfs-replication-check/ Microsoft iSCSI Software Target 3.3 released for download Download from the following link, note that it's only supported on W2k8R2 http://www.microsoft.com/downloads/en/details.aspx?FamilyID=45105d7f-8c6c-4666-a305-c8189062a0d0 http://jbits.se/blog/2011/04/19/microsoft-iscsi-software-target-33-released-for-download/ Disk Space Dictator ™ Use this script to remind users logging on to Mgmt or TS machines to keep their profile and recycle bin size down.  # Disk Space Dictator (tm) # (c) 2011 / jbjorkman $PSWarning=199 $RSWarning=99 [reflection.assembly]::loadwithpartialname("System.Windows.Forms") [reflection.assembly]::loadwithpartialname("System.Drawing") $ProfileSize=[math]::truncate((New-Object -com Scripting.FileSystemObject).GetFolder($Env:Userprofile).Size/1024/1024) $RecyclerSize=[math]::truncate((New-Object -com Scripting.FileSystemObject).GetFolder("C:\RECYCLER\"+(new-object system.security.principal.NtAccount($Env:userName)).translate([system.security.principal.securityidentifier]).Value).Size/1024/1024) $msg="Please help keep disk space usage down.`r`n`r`n" $msg=$msg+"This popup will warn you if your profile exceeds 200Mb,`r`n" $msg=$msg+"or if your ... http://jbits.se/blog/2011/03/10/disk-space-dictator-tm/ Powershell packet capture script written by Robbie Foust. http://blog.robbiefoust.com/?p=68 http://jbits.se/blog/2011/02/27/72/ Cisco ASA Packet Capture Start capture of everything on interface outside: #capture CAPFILE interface outside packet-length 1500 buffer 8192 Start capture on interface outside using access-list (define access-list first): #capture CAPFILE interface outside packet-length 1500 access-list 345 buffer 8192 Stop capture # no capture CAPFILE interface outside Fire up a browser and go to the following URL to fetch your ... http://jbits.se/blog/2011/02/27/cisco-asa-packet-capture/ Type performance counters to console using typeperf Typeperf is a command to echo performance counter data out to console (can also output to file or sql) typeperf "\Processor(_Total)\% Processor Time" -si 0:0:5 -sc 5 http://jbits.se/blog/2011/02/24/type-performance-counters-to-console-using-typeperf/ Prevent W2k8+ from registering all adapter IPs in DNS Normal behaviour for Windows 2008 onwards is to register all IPs for a certain adapter in DNS if dynamic dns registration is enabled. To prevent this behaviour you need to install below mentioned hotfix and add the addresses using the following netsh syntax: Netsh int ipv4 add address skipassource=true http://support.microsoft.com/kb/975808/EN-US http://jbits.se/blog/2011/02/24/prevent-w2k8-from-registering-all-adapter-ips-in-dns/ Disable IIS Socketpooling By default, IIS will bind a certain port to all IPs sharing NIC. To disable this behaviour you need to disable socket pooling. You do this providing a list of ip:port pairs to listen to, with socket pooling enabled the list is usually empty For IIS6 you can use httpcfg.exe from support tools. httpcfg.exe ... http://jbits.se/blog/2011/02/23/disable-iis-socketpooling/ PowerShell WMI Eventsink example To clear all currently registered eventhandlers: Get-EventSubscriber | % {Unregister-Event $_.SubscriptionID} Capture Service Status changes (Example uses Wireless Zero Configuration): Register-WmiEvent -Query "select * from __InstanceModificationEvent within 2 where targetinstance isa 'win32_service' and targetinstance.name= 'WZCSVC'" -sourceIdentifier "WZCSVC Status" -action { $evt=$event.SourceEventArgs.newEvent.TargetInstance ; Write-Host $evt.DisplayName $evt.State on $evt.Systemname} http://jbits.se/blog/2011/02/10/powershell-wmi-eventsink-example/ Renew IP Addresses using Powershell WMI   ([wmiclass]"Win32_NetworkAdapterConfiguration").RenewDHCPLeaseAll() http://jbits.se/blog/2011/02/05/renew-ip-addresses-using-powershell-wmi/