Showing posts with label wsman. Show all posts
Showing posts with label wsman. Show all posts

Thursday, January 26, 2012

PSRemoting out of memory (NTDSUTIL)

I'm in the process of creating a domain controller build automation script.  One of the steps I had hoped to achieve was to connect to the nearest 2008R2 domain controller and run the ntdsutil scripted command:

ntdsutil ifm "activate instance ntds" ifm "create sysvol full d:\ifm"

on the remote system.  This can be done through invoke-command with this command as the scriptblock, however it was failing with a JET out of memory exception.

     Target Database: d:\ifm\Active Directory\ntds.dit

                  Defragmentation  Status (% complete)

          0    10   20   30   40   50   60   70   80   90  100
          |----|----|----|----|----|----|----|----|----|----|
          ........Operation terminated with error -1011( JET_errOutOfMemory, Out of Memory ).
 error 0x800720d9(A database error has occurred.)

Searching around a bit, led to finding the WSMAN limitations of per shell memory.  Configured as:


Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1024

Configuring this on the local machine (the non-domain controller) didn't help.  Trying to configure it on the remote machine with invoke-command gives access denied.  To work on the remote machine, I found this helpful article which shows the Connect-wsman commandlet connecting to a remote machine:

connect-wsman remotemachine
set-item wsman:\remotemachine\Shell\MaxMemoryPerShellMB 1024

This setting chance was enough to complete the IFM collection on the remote machine.