Hello,
I got two server running on View 4.5.
I need to use the view cmdlet but each time i'm trying to launch the VMware View PowerCLI, i got the same error on both server.
Add-PSSnapin : The Windows PowerShell snap-in 'VMware.View.Broker' is not installed on this machine.
At D:\apps\VMware\VMware View\Server\extras\PowerShell\add-snapin.ps1:30 char:14
+ add-PSSnapin <<<< $view_snapin_name
+ CategoryInfo : InvalidArgument: (VMware.View.Broker:String) [Add-PSSnapin], PSArgumentException
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
I've try to manually install it.
In the view 45 integration guide : The script configuration file for the View PowerCLI cmdlets is named InitViewCmdlets.ps1.
I can't find this script.
Done multiple reinstallation.
If anyone have an idea
Ok, it looks as if the script is choosing the 32-bit InstallUtil rather than the 64-bit.
Can you try running the following command to install the snapin?
C:\WINNT\Microsoft.NET\Framework64\v2.0.50727\installUtil <View Path>\bin\PowershellServiceCmdlets.dll
Where <View Path> is where you installed your Connection Server.
If this works, running the script should work as it won't be trying to install the snapin again, and will just load it using Add-PSSnapin.
Don't you have the Extras folder in the View installation folder ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes ,
Inside this folder, i have 5 more folders with the one "powershell"
Inside powershell the 2 script : add-snapin.ps1 and uninstall-snapin.ps1.
But i can't find the InitViewCmdlets.ps1.
Any idea ?
Thread moved to the View Community.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
After installing a 2008R2 (Before i was on 2003) server and installing the same View 4.5
Got the snap-in installed correctly.
Don't know where the error was ...
you have to have powershell feature in your windows machine. by default windows 2003 doesn't have powershell installed. but win2008 by default has this feature.
-noble
Yes, i know that.
I have try with Powershell v1 and v2 and i was always getting the same error.
Ran into the same issue today and narrowed it down to the fact that "Add-PSSnapin VMware.View.Broker" only works on the primary Connection Server.
Running it from my replica server returns the same error that VMware.View.Broker is not installed.
Sorry to hear you've been having trouble, got a few questions that might narrow the problem down:
What OSs are your main broker and replica servers running on? Are they 32/64 bit?
Have you installed to the default directory?
Hello
The main server is a Windows 2003 R2 64bits and the replica is a 2008R2.
The file aren't installed to the default directory ( > d:\soft\... )
Not figured out what's going on yet, but I've not forgotten!
I've setup a replica on 2k8 R2 with a nonstandard install directory. That worked ok. Haven't tried somewhere other than the C: drive, which will take a little longer to set up.
If that still works, I'll look into where it might be falling over in the launch script.
Ok, all working fine for me, but we can do something to get more info:
Can you edit the add-snapin.ps1 file (in extras\PowerShell under View's install dir) and replace this line:
$null = (installUtil ($installpath + "\bin\PowershellServiceCmdlets.dll"))
with
(installUtil ($installpath + "\bin\PowershellServiceCmdlets.dll"))
Removing the $null assignment will give us the output from the installUtil tool, which I believe is the most likely place this could be falling over.
Once you've made the change and re-run the script, if you post the output for me, I should be able to see what's going on a bit better.
Cheers,
Tom
The problem is on the main server which is a 2K3 x64 sp2, the replica 2008r2 is fully working.
by deleting the $null i'm getting this output.
To get View PowerCLI to work for us...
1) We had to make sure it was running on a View Connection Broker Server
2) We had to run start Windows Power Shell (we use the following batch command)
cd %Systemroot%\system32\Windowspowershell\v1.0
powershell c:\viewscripts\refreshpool.ps1
3) Then at the top of the PS1 script we need to have the following
function LoadSnapin{
Add-PSSnapin VMware.View.Broker -ErrorAction SilentlyContinue
}
LoadSnapin
After we did all three things as above the View PowerCLI works great. What we have it do is each night for the selected Pools we have it find all the desktops in the pool and and do a linkedclonerefresh which make sure each desktop is clean and we don't have to take the hit on doing refreshes on logoff during the day....
Thanks Camek, this will only work if you've successfully launched View PowerCLI once using add-snapin.ps1 (such as from the Start Menu), which will install the snapin so it can be added to a session as you've described. Alternatively, the snapin can be installed manually using the InstallUtil.
In the error listed in Avial's post, it looks as if the snapin cannot be installed at all.
Avial, I have a sneaking suspicion that the script is using the wrong version of InstallUtil. Can you add a line to the .ps1 file that will echo the value of the installUtil alias?
Get-Alias installUtil
I agree it should work that way but we never could get the install working on 2008R2 box so we dropped back to our current method. Not a big deal for us as we only run batch scripts....
By adding the Get-alias i get this output
Ok, it looks as if the script is choosing the 32-bit InstallUtil rather than the 64-bit.
Can you try running the following command to install the snapin?
C:\WINNT\Microsoft.NET\Framework64\v2.0.50727\installUtil <View Path>\bin\PowershellServiceCmdlets.dll
Where <View Path> is where you installed your Connection Server.
If this works, running the script should work as it won't be trying to install the snapin again, and will just load it using Add-PSSnapin.
Thank you Tom, this work fine