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://wordpress.org/?v=2.3.1 en Powershell DFS Replication Check http://jbits.se/blog/2011/09/15/powershell-dfs-replication-check/ http://jbits.se/blog/2011/09/15/powershell-dfs-replication-check/#comments Thu, 15 Sep 2011 15:46:24 +0000 jbjorkman http://jbits.se/blog/2011/09/15/powershell-dfs-replication-check/ Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/simple-popup-images/popup-images.php on line 33
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 + "'" $RGConnections = Get-WmiObject -Namespace [...]]]>
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 + "'"
$RGConnections = Get-WmiObject -Namespace "root\MicrosoftDFS" -Query  $RGConnectionsWMIQ
foreach ($Connection in $RGConnections)
{
$ConnectionName = $Connection.PartnerName.Trim()
if ($Connection.Enabled -eq $True)
{
if (((New-Object System.Net.NetworkInformation.ping).send("$ConnectionName")).Status -eq "Success")
{
foreach ($Folder in $RGFolders)
{
$RGName = $Group.ReplicationGroupName
$RFName = $Folder.ReplicatedFolderName

if ($Connection.Inbound -eq $True)
{
$SendingMember = $ConnectionName
$ReceivingMember = $ComputerName
$Direction="inbound"
}
else
{
$SendingMember = $ComputerName
$ReceivingMember = $ConnectionName
$Direction="outbound"
}

$BLCommand = "dfsrdiag Backlog /RGName:'" + $RGName + "' /RFName:'" + $RFName + "' /SendingMember:" + $SendingMember + " /ReceivingMember:" + $ReceivingMember
$Backlog = Invoke-Expression -Command $BLCommand

$BackLogFilecount = 0
foreach ($item in $Backlog)
{
if ($item -ilike "*Backlog File count*")
{
$BacklogFileCount = [int]$Item.Split(":")[1].Trim()
}
}

     if ($BacklogFileCount -eq 0)
{
$Color="white"
$Succ=$Succ+1
}
elseif ($BacklogFilecount -lt 10)
{
$Color="yellow"
$Warn=$Warn+1
}
else
{
$Color="red"
$Err=$Err+1
}
Write-Host "$BacklogFileCount files in backlog $SendingMember->$ReceivingMember for $RGName" -fore $Color

} # Closing iterate through all folders
} # Closing  If replies to ping
} # Closing  If Connection enabled
} # Closing iteration through all connections
} # Closing iteration through all groups
Write-Host "$Succ successful, $Warn warnings and $Err errors from $($Succ+$Warn+$Err) replications."

]]>
http://jbits.se/blog/2011/09/15/powershell-dfs-replication-check/feed/
Microsoft iSCSI Software Target 3.3 released for download http://jbits.se/blog/2011/04/19/microsoft-iscsi-software-target-33-released-for-download/ http://jbits.se/blog/2011/04/19/microsoft-iscsi-software-target-33-released-for-download/#comments Tue, 19 Apr 2011 09:38:42 +0000 jbjorkman http://jbits.se/blog/2011/04/19/microsoft-iscsi-software-target-33-released-for-download/ Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/simple-popup-images/popup-images.php on line 33
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 ]]>
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/feed/
Disk Space Dictator ™ http://jbits.se/blog/2011/03/10/disk-space-dictator-tm/ http://jbits.se/blog/2011/03/10/disk-space-dictator-tm/#comments Thu, 10 Mar 2011 08:58:20 +0000 jbjorkman http://jbits.se/blog/2011/03/10/disk-space-dictator-tm/ Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/simple-popup-images/popup-images.php on line 33
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 system drive recycle bin exceeds [...]]]>
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 system drive recycle bin exceeds 100Mb.`r`n"

$Warn=$False
If ($ProfileSize -gt $PSWarning) { $msg=$msg+"`r`nYour profile is $ProfileSize Mb." ; $Warn=$true}
If ($RecyclerSize -gt $RSWarning) { $msg=$msg+"`r`nYou have $RecyclerSize Mb in the recycle bin" ; $Warn=$true}
If($Warn) {
 $icon=[system.drawing.icon]::ExtractAssociatedIcon((join-path $pshome powershell.exe))
 $notify = new-object system.windows.forms.notifyicon
 $notify.icon = $icon
 $notify.visible = $true
 $notify.showballoontip(20,"Disk Space Dictator (tm)",$msg, [system.windows.forms.tooltipicon]::Info)
 Start-sleep 15
 $notify.visible=$false
}

]]>
http://jbits.se/blog/2011/03/10/disk-space-dictator-tm/feed/
http://jbits.se/blog/2011/02/27/72/ http://jbits.se/blog/2011/02/27/72/#comments Sun, 27 Feb 2011 09:05:35 +0000 jbjorkman http://jbits.se/blog/2011/02/27/72/ Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/simple-popup-images/popup-images.php on line 33
Powershell packet capture script written by Robbie Foust. http://blog.robbiefoust.com/?p=68 ]]>
Powershell packet capture script written by Robbie Foust.

http://blog.robbiefoust.com/?p=68

]]>
http://jbits.se/blog/2011/02/27/72/feed/
Cisco ASA Packet Capture http://jbits.se/blog/2011/02/27/cisco-asa-packet-capture/ http://jbits.se/blog/2011/02/27/cisco-asa-packet-capture/#comments Sun, 27 Feb 2011 08:46:53 +0000 jbjorkman http://jbits.se/blog/2011/02/27/cisco-asa-packet-capture/ Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/simple-popup-images/popup-images.php on line 33
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 capture (Other protocols can be [...]]]>
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 capture (Other protocols can be used too):
https://ASA-IP/capture/CAPFILE/pcap

Clean up
# no capture MYCAP

]]>
http://jbits.se/blog/2011/02/27/cisco-asa-packet-capture/feed/
Type performance counters to console using typeperf http://jbits.se/blog/2011/02/24/type-performance-counters-to-console-using-typeperf/ http://jbits.se/blog/2011/02/24/type-performance-counters-to-console-using-typeperf/#comments Thu, 24 Feb 2011 11:42:26 +0000 jbjorkman http://jbits.se/blog/2011/02/24/type-performance-counters-to-console-using-typeperf/ Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/simple-popup-images/popup-images.php on line 33
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 ]]>
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/feed/
Prevent W2k8+ from registering all adapter IPs in DNS http://jbits.se/blog/2011/02/24/prevent-w2k8-from-registering-all-adapter-ips-in-dns/ http://jbits.se/blog/2011/02/24/prevent-w2k8-from-registering-all-adapter-ips-in-dns/#comments Thu, 24 Feb 2011 09:01:19 +0000 jbjorkman http://jbits.se/blog/2011/02/24/prevent-w2k8-from-registering-all-adapter-ips-in-dns/ Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/simple-popup-images/popup-images.php on line 33
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 ]]>
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/feed/
Disable IIS Socketpooling http://jbits.se/blog/2011/02/23/disable-iis-socketpooling/ http://jbits.se/blog/2011/02/23/disable-iis-socketpooling/#comments Wed, 23 Feb 2011 12:52:37 +0000 jbjorkman http://jbits.se/blog/2011/02/23/disable-iis-socketpooling/ Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/simple-popup-images/popup-images.php on line 33
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 set iplisten -i 0.0.0.0:80 httpcfg.exe set [...]]]>
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 set iplisten -i 0.0.0.0:80
httpcfg.exe set iplisten -i 10.0.0.1:443

For IIS7 you use netsh
netsh http add iplisten ipaddress=0.0.0.0:80
netsh http add iplisten ipaddress=10.0.0.1:443

http://support.microsoft.com/kb/238131

]]>
http://jbits.se/blog/2011/02/23/disable-iis-socketpooling/feed/
PowerShell WMI Eventsink example http://jbits.se/blog/2011/02/10/powershell-wmi-eventsink-example/ http://jbits.se/blog/2011/02/10/powershell-wmi-eventsink-example/#comments Thu, 10 Feb 2011 13:52:29 +0000 jbjorkman http://jbits.se/blog/2011/02/10/powershell-wmi-eventsink-example/ Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/simple-popup-images/popup-images.php on line 33
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} ]]>
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/feed/
Renew IP Addresses using Powershell WMI http://jbits.se/blog/2011/02/05/renew-ip-addresses-using-powershell-wmi/ http://jbits.se/blog/2011/02/05/renew-ip-addresses-using-powershell-wmi/#comments Sat, 05 Feb 2011 19:02:26 +0000 jbjorkman http://jbits.se/blog/2011/02/05/renew-ip-addresses-using-powershell-wmi/ Deprecated: preg_replace() [function.preg-replace]: The /e modifier is deprecated, use preg_replace_callback instead in /var/www/myfoto.se/jbits.se/blog/wp-content/plugins/simple-popup-images/popup-images.php on line 33
  ([wmiclass]"Win32_NetworkAdapterConfiguration").RenewDHCPLeaseAll() ]]>
  ([wmiclass]"Win32_NetworkAdapterConfiguration").RenewDHCPLeaseAll()

]]>
http://jbits.se/blog/2011/02/05/renew-ip-addresses-using-powershell-wmi/feed/