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.


 

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
      }
  }
}


 

I spent hours trying to figure out why my ASP.Net page, which uses a master page with a RadGrid surrounded by a RadAjaxPanel with an AjaxLoadingPanel, would not show the loading message.  I would click on the link to the page in the site menu, then IE would sit and spin for a while until it loaded the entire page, rather than loading the page right away but showing the loading spinner until the data was returned.  What I had to do was add this javascript (w/jQuery) to the user control that the grid was in:

<script type="text/javascript">
    $(document).ready(function() {
        setTimeout(loadGrid, 500);       
    });

    function loadGrid() {
        window['<%=RadAjaxPanel1.ClientID %>'].AjaxRequest('');
    }   
</script>

I'm not sure why I had to make it sleep for half a second, but it wouldn't work until I added that.

I set up a server-side event (OnAjaxRequest="RadAjaxPanel1_AjaxRequest") that fires when AjaxRequest is called in the javascript:

protected void RadAjaxPanel1_AjaxRequest(object sender, AjaxRequestEventArgs e) {
 Presenter.InitializeView();
 BindGrid();
}