Nothing happens when I execute the veeam powershell script?

PowerShell script exchange

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby Mike Resseler » Tue Apr 11, 2017 6:18 am

Hi again,

From what I can see, it looks like you are not receiving all the information. I am going to ask you to do this "script" again but just copy/ paste the lines in the script pane of that ISE program we talked about.
Then, you have the possibility to run line by line and see what happens. (Select a line, press F8, then select the next line, press F8 and so on...) Normally I would expect that you see two outputs. The one you pasted above is the output for the variable $server (so we know that that one works :-)). But then you should also have an output for $VM and I cannot see that one.

Maybe really stupid but is your VMname actually ama-dc1 or is it named differently in Hyper-V manager?

thanks
Mike
Mike Resseler
Veeam Software
 
Posts: 3382
Liked: 384 times
Joined: Fri Feb 08, 2013 3:08 pm
Location: Belgium, the land of the fries, the beer, the chocolate and the diamonds...
Full Name: Mike Resseler

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby v.Eremin » Tue Apr 11, 2017 9:47 am

Right, with the revised script it returned this:

Only Hyper-V server gets returned, which means that VM with the given name cannot be found.

Can you see it, if you go to a backup console -> Virtual Machines node and expand the Hyper-V server? If yes, what exact name does it have?

Thanks.
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1025 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby daystrom » Wed Apr 12, 2017 5:01 pm

So, nothing looks wrong with the script, but it fails? It must be working for many of you, and my case is very simple.
daystrom
Influencer
 
Posts: 15
Liked: never
Joined: Sun Apr 09, 2017 6:32 pm

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby v.Eremin » Wed Apr 12, 2017 5:32 pm

The script does not fail, it works, however, it does not return a specific VM you're trying to backup. If you go to backup console, open the Virtual Machines node, can you see the given VM there? What name does it have?

Can you also run the following script and check the list of object names returned by it?

Code: Select all
Asnp VeeamPSSnapin
$HostName = "AMA-VH01"
$Server = Get-VBRServer -name $HostName
Find-VBRHvEntity -Server $Server | select name


Thanks
v.Eremin
Veeam Software
 
Posts: 13709
Liked: 1025 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby daystrom » Wed Apr 12, 2017 8:14 pm

Ack, apologies...since a day or two ago I had thought no one had posted new comments. I was refreshing the page I'd posted to, and it happened that my post was the last one on page 1, so the new comments never appeared in the browser. After my post today I saw the stuff on page 2. I am not getting notifications re new postings from this forum.

Here is the output from the test requested by v.Eremin

PS C:\scripts> .\test02.ps1

Info : ama-vh01 (Microsoft Hyper-V Server)
ParentId : 00000000-0000-0000-0000-000000000000
Id : 1b42f5d8-2c94-4c16-bcb6-0e0b93d98721
Name : ama-vh01
Reference :
Description : Created by AMA\someadmin at 12/14/2015 3:07:19 PM.
IsUnavailable : False
Type : HvServer
ApiVersion : Unknown
PhysHostId : d7c4ff97-b99b-4d1f-884d-283b7b6b9ee3
ProxyServicesCreds : Veeam.Backup.Common.CCredentials

You had earlier asked "Can you see it, if you go to a backup console -> Virtual Machines node and expand the Hyper-V server? If yes, what exact name does it have? "

In the veeam backup and replication console it's like this:
Infrastructure
--Microsoft Hyper-V
----AMA-vh01

If I select AMA-vh01 in that left side VIRTUAL MACHINES area, the main panel on the right shows the three vms that run on AMA-VH01
AMA-DC1
AMA-APPS1
AMA-Test

In this initial test I intend to include only AMA-DC1 in the backup, but later would add the AMA-APPS1 server.

BTW, the host AMA-VH01 is windows server std, not R2. I think I mentioned that early on but am not sure. Is R2 needed to get veeam to work with ps?
daystrom
Influencer
 
Posts: 15
Liked: never
Joined: Sun Apr 09, 2017 6:32 pm

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby daystrom » Wed Apr 12, 2017 8:31 pm

This is in reponse to Mike's request. In ps ise, using F8:

Asnp VeeamPSSnapin
$VMName = "AMA-DC1"
$HostName = "AMA-VH01"
$Server = Get-VBRServer -name $HostName
$Server
$VM = Find-VBRHvEntity -Name $VMName -Server $Server
$VM

All the script is doing is setting up two variables with the host name and vm name, instantiating the host, which is successful, and then attemping to locate the vm via expected vm name, and it returns nothing. That's correct? The vm name is correct. I tried the script with another of the vm names with the same result - nothing found.
daystrom
Influencer
 
Posts: 15
Liked: never
Joined: Sun Apr 09, 2017 6:32 pm

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby Mike Resseler » Thu Apr 13, 2017 5:09 am

Strange,

$VM should give you an output as V.Eremin and I already said. However, did you run the last script he asked? Because that last script should have given an output as such:

Name
------
AMA-VH01
AMA-DC01
AMA-APPS1
AMA-TEST
Mike Resseler
Veeam Software
 
Posts: 3382
Liked: 384 times
Joined: Fri Feb 08, 2013 3:08 pm
Location: Belgium, the land of the fries, the beer, the chocolate and the diamonds...
Full Name: Mike Resseler

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby daystrom » Thu Apr 13, 2017 2:48 pm

You're right, that was an error on my part, that was the wrong script output I showed. This is what the v.eremin shows


Name
----
ama-vh01
AMA-DC1 - Windows 2012 AD-FSMO Server - PRODUCTION
AMA-TEST
AMA-APPS1 - Windows 2012 Primary App Server - PRODUCTION
daystrom
Influencer
 
Posts: 15
Liked: never
Joined: Sun Apr 09, 2017 6:32 pm

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby daystrom » Thu Apr 13, 2017 2:56 pm

So, mystery solved - I never imagined that "AMA-DC1 - Windows 2012 AD-FSMO Server - PRODUCTION" was actually the name of the vm. I thought it was the name plus some kind of descriptor field. I didn't set these servers up. Anyways that's kind of a funny result to all of this. The test script now works as expected and no doubt the ps backup script will work too. Thanks to both of you for your help!
daystrom
Influencer
 
Posts: 15
Liked: never
Joined: Sun Apr 09, 2017 6:32 pm

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby Mike Resseler » Thu Apr 13, 2017 3:34 pm

That is one hell of a name :-)

Since these are the names of the VM's, you can always use Hyper-V Manager and change those. However, be aware that there might be some other scripts or tools that use that specific name

Anyway, glad it is solved now!
Mike Resseler
Veeam Software
 
Posts: 3382
Liked: 384 times
Joined: Fri Feb 08, 2013 3:08 pm
Location: Belgium, the land of the fries, the beer, the chocolate and the diamonds...
Full Name: Mike Resseler

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby daystrom » Thu Apr 13, 2017 4:57 pm

BTW, is there a trick to getting notification by email of subscribed threads? At the bottom of this page is

Board index Subscribe topic Bookmark topic

and there is a checkbox next to subscribe. Clicking the checkbox does nothing - it's already checked, doesn't change value, possibly because I'm the OP? Nothing in spam folder. But I have never gotten any notices about this thread. I don't see any other switch for subscribing.
daystrom
Influencer
 
Posts: 15
Liked: never
Joined: Sun Apr 09, 2017 6:32 pm

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby Mike Resseler » Thu Apr 13, 2017 5:28 pm

Normally when you click on the checkbox, it should become an 'x' instead of (some sort of) a 'v'. When it is an x, you are subscribed and you should get notifications
Mike Resseler
Veeam Software
 
Posts: 3382
Liked: 384 times
Joined: Fri Feb 08, 2013 3:08 pm
Location: Belgium, the land of the fries, the beer, the chocolate and the diamonds...
Full Name: Mike Resseler

Re: Nothing happens when I execute the veeam powershell scri

Veeam Logoby daystrom » Thu Apr 13, 2017 5:48 pm

It turns out that clicking the "check" does not do anything at all - it's an image and that's all. The text "subscribe topic" does take the action and the image goes from a check to an x. Pretty strange design by phpBB but that is how it works.
daystrom
Influencer
 
Posts: 15
Liked: never
Joined: Sun Apr 09, 2017 6:32 pm

Previous

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 1 guest