Quantcast
Channel: PowerShell Server
Viewing all 45 articles
Browse latest View live

PowerShell Server: Unable to execute Virtual Box commands.

$
0
0

Problem Description

When attempting to manage Virtual Box VMs from the PowerShell Server prompt, the user may see the following error:

.\VBoxManage.exe : VBoxManage.exe: error: Could not find a registered machine
named 'CentOS-6.4-i386-Gnome'
At line:1 char:1
+ .\VBoxManage.exe startvm CentOS-6.4-i386-Gnome
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (VBoxManage.exe:...6.4-i386-Gnome'
:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001),
component VirtualBox, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(pszVM).raw(),
machine.asOutParam())" at line 575 of file VBoxManageMisc.cpp

Cause

There appears to be an issue with the sharing of Virtual Box’s internal registry of VMs in remote sessions. Due to this issue, any VMs previously registered in a local session or another remote session are not recognized as registered VMs.

Solution

The solution to this issue is quite simple. All that is needed is to register the VM in the PowerShell Server session. Once this is done you will again be able to manage the Virtual Box VM. Please see the example below:


PS> .\vboxmanage.exe registervm "C:\Users\myUser\VirtualBox VMs\test\test.vbox"

PS> .\vboxmanage.exe startvm test --type headless

Note: When registering the VM, the user must specify the full path to the VM’s .vbox file.

Note 2: The “–type headless” parameter in the Start VM command indicates that the VM will be started silently with no user interaction. See: VirtualBox Manual: vboxmanage startvn


Using the Quest AD Cmdlets

$
0
0
 Requirements: PowerShell Server Quest AD Cmdlets Any SSH Client Introduction This tutorial was designed to focus on what is required to run the Quest AD Cmdlets within PowerShell Server. It does not cover setting up PowerShell Server or connecting to the server. Please not…

Using Secure Copy Protocol (SCP) To Upload and Download Files

$
0
0
 When Secure Copy Protocol (SCP) is enabled on the PowerShell Server, an SCP client can connect and upload or download files. Below is a description of a variety of common methods used to send and receive files over SCP with the PowerShell Server. Enabling SCP By default, t…

PowerShell ASP: Using Invoke-Command with New-PSSession

$
0
0
 In order to use the Invoke-Command with the New-PSSession cmdlet you will need to have the proper credentials set. The credential parameter in Powershell taks a PSCredential object. Normally you would prompt a user to enter the information in a dialog and then save the res…

PowerShell Server: Unable to execute Virtual Box commands.

$
0
0
Problem Description When attempting to manage Virtual Box VMs from the PowerShell Server prompt, the user may see the following error: .\VBoxManage.exe : VBoxManage.exe: error: Could not find a registered machine named 'CentOS-6.4-i386-Gnome' At line:1 char:1 + .\VBoxManage.…

PowerShell Server: Some commands cause the console to hang (e.g., Vim, Emacs, etc)

$
0
0
 Problem Description Attempting to use some tools, such as the editors Vim or Emacs, causes PowerShell Server to hang until the executed command is forcefully stopped (e.g., CTRL+C). Cause This issue is actually a limitation of the manner in which PowerShell operates. Funda…

PowerShell Server: SFTP Scripting

$
0
0
 Introduction By default, the SFTP Server will act as a standard SFTP server and provide file management functionality for the specified root directory. In some cases, it may be desirable to implement advanced functionality. PowerShell Server provides an advanced SFTP scrip…

PowerShell Server: Setting up Dynamic Port Forwarding

$
0
0
 Introduction It is possible to use PowerShell Server to perform Dynamic Port Forwarding, but most of the configuration will be done to an SSH client (such as PuTTY ) and in the options for your web browser. Step 1 Start PowerShell Server as normal. Step 2 In your SSH clien…

PowerShell Server: Security Questions and Answers

$
0
0
 Introduction PowerShell Server provides a secure mechanism to connect to remote machines and execute PowerShell scripts. This document will cover some of the common questions specific to the security options used by PowerShell Server. What SSH protocol does PowerShell SSH …

PowerShell Server: Executing scripts in an x86 runspace

$
0
0
 In some situations a user will have a script or module that is not compatible with a 64-bit architecture. While PowerShell Server cannot be configured to run in a 32-bit runspace itself, it is easy to execute a script in a 32-bit runspace by using the following script: if …

PowerShell Server vs. PowerShell Remoting

$
0
0
 This article will explain the differences between PowerShell Server , and a remoting alternative: PowerShell Remoting via WinRM. With PowerShell Server, you are not limited to Windows machines and you do not need WinRM or any other software besides the PowerShell Server it…

PowerShell Server: Changing the Terminal Width

$
0
0
 The PowerShell terminal defaults to a width of 80 columns, but sometimes a user will need a larger or smaller display width. Changing the terminal width in PowerShell Server can be easily accomplished with some code similar to the following: $pshost = Get-Host # Get the Po…

PowerShell Server: Cannot load Windows PowerShell snap-in Microsoft.Exchange.Management.PowerShell.e2010

$
0
0
 Problem Description When attempting to load the Microsoft Exchange 2010 cmdlets in PowerShell Server you may see the following error: Exception type: PSSnapInException Exception message: Cannot load Windows PowerShell snap-in Microsoft.Exchange.Management.PowerShell.e2010 …

Isolated Sessions, User Accounts, and Impersonation

$
0
0
 Isolated Sessions When PowerShell Server is configured to run as a Windows Service, a new process is launched to host the PowerShell Runspace as the logged in user. This causes any processes created from PowerShell to also run from this same user account. When running Powe…

PowerShell ASP: Enabling Impersonation

$
0
0
 Introduction When PowerShell ASP is hosted in IIS , it is possible to enable impersonation. This means that the webpage will run under the identity of the individual that has accessed the page. This document will describe the steps needed to enable impersonation for a Powe…

PowerShell ASP: Could not load file or assembly nsoftware.PowerShellASP in IIS.

$
0
0
 Problem Description When creating a handler mapper to support PowerShell ASP in IIS you can sometimes get the following error: Could not load file or assembly nsoftware.PowerShellASP or one of its dependencies. This assembly is built by a runtime newer than the currently l…

Obtaining current user information in PowerShell Server.

$
0
0
 Depending on your PowerShell Server settings sometimes getting session user information from the server might return unexpected results. For example if you are running your server as a service where “Isolated Sessions” are disabled, making the call: PS> [Environment]::GetE…

Manage Exchange Server Remotely With PowerShell Server

$
0
0
 Requirements: PowerShell Server Microsoft Exchange Any SSH Client Introduction Microsoft Exchange contains the Exchange Management Shell which is built on Windows PowerShell technology. The Exchange Management Shell contains a command-line interface, a PowerShell snap-in, …

PowerShell ASP: List Current Sessions of Machines on an Active Directory Domain

$
0
0
 Requirements: PowerShell Server PSTerminalServices Overview By combining several techniques, this article walks through creating a page that lists the current sessions for machines on an Active Directory domain. This article provides step by step instructions on how to cre…

PowerShell ASP: Hosting PowerShell ASP in IIS

$
0
0
 Hosting PowerShell ASP in IIS is a very simple and straight-forward process. This article uses IIS 7.5, but the process is very similar for other versions of IIS. The first step is to open IIS and expand your Server, then site. Next, right-click the site and select “Add Ap…
Viewing all 45 articles
Browse latest View live