2

I am running a simple cmdlet with Powershell 5.1, winver 1803.

I am running:

Rename-Computer -ComputerName $pc -NewName $newName -DomainCredential $cred -Restart

This command is part of a script. Everything in the script works - and this line used to work, but for some reason it stopped.

The exception is:

Fail to rename computer '$pc' to '$newName' due to the following exception: Not enough quota is available to process this command.

There are no memory or page-file size issues. There are no other applications even running. Page file size is in excess of 8GB.

WinRM is running, stack 3.0.

Why on earth is this command producing this error? How might I troubleshoot it?

UPDATE

This is what I am seeing...

Rename-Computer : Fail to rename computer 'W4000100' to 'W1401-TR100' due to the following exception: Not enough quota is available to process this command. At line:2 char:9 + Rename-Computer -ComputerName $pc -NewName $newName -DomainCr ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (W4000100:String) [Rename-Computer], InvalidOperationException + FullyQualifiedErrorId : FailToRenameComputer,Microsoft.PowerShell.Commands.RenameComputerCommand Rename-Computer : Fail to rename computer 'W4000100' to 'W1401-TR100' due to the following exception: Not enough quota is available to process this command. At line:2 char:9 + Rename-Computer -ComputerName $pc -NewName $newName -DomainCr ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (W4000100:String) [Rename-Computer], InvalidOperationException + FullyQualifiedErrorId : FailToRenameComputer,Microsoft.PowerShell.Commands.RenameComputerCommand

Again, this same message pops up if you try to rename a computer locally via the GUI, and also happens if I remove the hyphen from the name, etc.

m0lochwalker
  • 422
  • 3
  • 11
  • Potential dupe: https://stackoverflow.com/questions/52172993/does-powershell-have-a-limit-that-causes-the-error-not-enough-quota-is-available. Other suggestions as well on the network including the one answer on a C question https://stackoverflow.com/search?q=Not+enough+quota+is+available+to+process+this+command. – Matt Dec 07 '18 at 19:13
  • Are you sure `$newName` does not exceed the 15 character limit and there are no invalid characters in there? [Naming conventions](https://support.microsoft.com/en-gb/help/909264/naming-conventions-in-active-directory-for-computers-domains-sites-and) – Theo Dec 08 '18 at 21:54
  • @Theo Hi Theo - yes, $newName is a formatted string with 11 characters. The issue is found to be in the target/client side. Weird issue. Thank you for the suggestion! – m0lochwalker Dec 09 '18 at 14:23
  • @m0lochwalker Ah, bummer. It so happened I had this generic error once and it turned out to be a newline character that slipped in the calculated name. – Theo Dec 09 '18 at 15:22

2 Answers2

0

After researching, I believe this solution may solve your issue from the following article by Phil Coutard:

http://blog.coultard.com/2012/01/fix-windows-error-0x80070718-not-enough.html

This might be set on the user level. Try going to Control Panel, Sync Center, Offline Files, Manage Offline Files (left hand side), Disk Usage tab, Change Limits. It could be that your Disk Usage has a limit. Try that first and see if that fixes it.

UPDATE: If that doesn't work, since the error is so generic, I would recommend using Microsoft's Automatic diagnostic/repair tool: https://support.microsoft.com/en-us/help/17590/automatically-diagnose-and-repair-windows-file-and-folder-problems

Peter Kay
  • 926
  • 1
  • 7
  • 18
  • Offline Files are disabled on my machine. – m0lochwalker Dec 07 '18 at 19:45
  • @m0lochwalker I've updated my answer, could you run that tool to see if that resolved the issue? – Peter Kay Dec 07 '18 at 20:51
  • Update here, this error is actually what is kicking out on the remote system I am trying to rename. Try a manual rename on the machine spits out a shell window with this error. Same scenario - plenty of disk space/RAM aviailable...8GB page file. – m0lochwalker Dec 07 '18 at 21:33
  • @m0lochwalker if you have enough resources can you add 2gbs to your page file? Without much else information, I can only recommend trial and error solutions. What does your system log file show when you run the command? Also, please let me know what you see when you run get-process – Peter Kay Dec 07 '18 at 21:41
  • I increased the page file to 10k initial, 15k max, rebooted, it made no difference. There is nothing in the System or Application log that references the rename attempt. There is also nothing on the DC's. It is so bizarre. I still get the exact error I posted above when running Rename-Computer...: Not enough quota is available to process this command. – m0lochwalker Dec 11 '18 at 15:17
  • See if you're able to change the computer name via REGEDIT: "HKEY_LOCAL_MACHINE," "SYSTEM," "CurrentControlSet," "Control," "ComputerName" "ActiveComputerName." – Peter Kay Dec 12 '18 at 19:49
  • all that seems to do is brick access to the machine, hah. Been on the horn with MS. Their support doesn't have a clue to this point. – m0lochwalker Dec 13 '18 at 14:07
  • Wow, first time I’ve ever seen this happen. I think at this point, you’re better off wiping it clean and reinstalling the OS with a last known good image. – Peter Kay Dec 13 '18 at 14:15
0

The answer after troubleshooting with MS is that the image used for these systems was domain-joined at the time of capture. This results in each machine having the same AccountDomainSID, which apparently can cause many issues - however, this is the only issue we have identified as a result.

MS have pretty much stopped researching with me and say this is the cause and that the only fix is to remove from domain and rejoin.

m0lochwalker
  • 422
  • 3
  • 11
  • Glad it got sorted out! Having a clean image is always recommended when doing any type of sysprep/imaging with windows. – Peter Kay Jan 11 '19 at 17:56