Tuesday, October 21, 2014

Disable loopback on a website

If you need to access a sharepoint webapplication from the actual sharepointserver and you can’t seem to be able to authenticate properly. Then it’s possible a loopback issue. This is a slightly more proper way to do it. Still not recommended on a productionenvironment, but when in a tight spot, reach for the hammer. HKEY_LM\System\CCS\Control\LSA\MSV1.0 New Multi-string value Named: BackConnectionHostNames = sharepoint.mycompany.com  and /> iisreset /noforce   References:


Tuesday, October 07, 2014

Powershell and xml

For future reference
script to read properties from a xml file and update specified values.
More of a proof of concept than any real world usage.
Good for any cocktailparty
----------------xmllooptest.ps1 ---------
$path = split-path -parent $MyInvocation.MyCommand.Definition
$inputfile = $path + "\myinputfile3.xml"
[xml]$xmlinput = (Get-Content $inputFile)

write-host $xmlinput.main.configuration.name" is my value"
write-host "Server is:"$xmlinput.main.configuration.server
write-host "Result : "$xmlinput.main.configuration.result

Write-host "Looping sites..."
$sites = $xmlinput.main.sites.site
foreach ($site in $sites)
    write-host "-----"
    write-host $site.name
    write-host $site.property
    if ($site.name -match "my site 2")
    $site.property = "New property for site2"
    write-host $site.property
----------------- myInputfile3.xml------------


      my site 1
      My even newer property

      my site 2
      New property for site2