The Wrecking Bawl

Destructuring query language, one keyword at a time.


News


I spent the past day trying to figure out why I couldn't log in as myself, Sharepoint would always just say I was logged in as System Account.  After a ton of research and changing things I ran into this:

To fix this, you must run the following commands: stsadm -o updatefarmcredentials -identitytype NetworkService

followed by: iisreset

http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/8d8d9b30-0995-47ba-96e8-7b52872664f3

That solved my problem.  I'm using NTLM authentication and I set up a new Active Directory user called sharepointuser to be the identity for the app pool (changing the app pool from myself to that user probably helped, but that isn't what fixed it ultimately).  I'm pretty sure if I had set up sharepointuser before I installed MOSS 2007 on the Windows 2003 server and specified that user during the installation, I wouldn't have had the auth problems to begin with.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati


Here's a Powershell script I whipped up to copy all bak files from C:\TEMP to Y:\DEST.  It checks to make sure the file is present at the destination before it deletes it from the source.  I placed it in a ps1 (the extension for Powershell files) file and scheduled a task to execute a batch file that executes the ps1 file.  The reason I had to check for null is that Powershell is kinda dumb and if the source folder is empty it picks it up as a child and performs the Copy-item.

$oldPath = "C:\TEMP"
$newPath = "Y:\DEST"
$GciFiles = get-childitem $oldPath

foreach ($file in $GciFiles){
  Write-host $file.Name
  if(!($file.Name -eq $null) -and $file.Name.EndsWith(".bak")){
      Write-host "copying item "+($newPath+'\'+$file)
      Copy-item $oldPath\$file $newPath
      if (Test-path ($newPath+'\'+$file)) {
          Write-host "removing item "+($oldPath+'\'+$file)
          Remove-item ($oldPath+'\'+$file) -recurse
      }
  }
}

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati