Groups > Microsoft > Data Protection Manager > Re: DPM Powershell not working




DPM Powershell not working

DPM Powershell not working
Fri, 11 Apr 2008 20:54:00 -070
Hi,

I wat to run a simple one line command. Example: 

Rename-ProtectionGroup -ProtectionGroup R3DEVDB -NewName R3DEVDB1.

But all I get are errors. What am I doing wrong?

Here are the errors:

Rename-ProtectionGroup : Cannot bind parameter 'ProtectionGroup'. Cannot 
convert value "R3DEVDB" to type "Microsoft.Internal
.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup". Error: 
"Invalid cast from 'System.String' to 'Microsoft.Int
ernal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup'."
At line:1 char:40
Post Reply
Re: DPM Powershell not working
Sat, 12 Apr 2008 09:23:00 -070
Hi, 
Thanks for the response. I tried it and it still doesnt work. After hours of 
trying to figure this out, I realized that the $mypg is always null. 

Why is that? Can you try and make it work on your end and let me know what 
the correction is?
Thanks,
QV

"Vikash Jain [MSFT]" wrote:

> Hi,
> The reason for the error you see is that, the Rename-ProtectionGroup 
> commandlet expects a ProtectionGroup object as parameter and you are
passing 
> a string as input.
> 
> The correct usage would be
> $pglist = Get-ProtectionGroup -DPMServerName <DPMServerName>
> $mypg = $pglist | where-object {$_.Name -like "R3DEVDB"}
> Rename-ProtectionGroup -ProtectionGroup $mypg -NewName R3DEVDB1
> 
> Please let me know if this does not solve your issue.
> 
> Thanks,
> Vikash [MSFT]
> 
> This posting is provided "AS IS" with no warranties, and confers
no rights
> 
> "qvalor" <qvalor@discussions.microsoft.com> wrote in
message 
> news:6BF188D5-EFA6-4C34-8EE2-C949146C4C69@microsoft.com...
> > Hi,
> >
> > I wat to run a simple one line command. Example:
> >
> > Rename-ProtectionGroup -ProtectionGroup R3DEVDB -NewName R3DEVDB1.
> >
> > But all I get are errors. What am I doing wrong?
> >
> > Here are the errors:
> >
> > Rename-ProtectionGroup : Cannot bind parameter 'ProtectionGroup'.
Cannot
> > convert value "R3DEVDB" to type "Microsoft.Internal
> > .EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup".
Error:
> > "Invalid cast from 'System.String' to 'Microsoft.Int
> >
ernal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup'."
> > At line:1 char:40
> > + Rename-ProtectionGroup -ProtectionGroup  <<<< R3DEVDB
-NewName R3DEVDB1 
> 
> 
Post Reply
Re: DPM Powershell not working
Sat, 12 Apr 2008 09:25:00 -070
Also, ever so often I get that Get-ProtectionGroup is not a valid commandlet.

"qvalor" wrote:

> Hi, 
> Thanks for the response. I tried it and it still doesnt work. After hours
of 
> trying to figure this out, I realized that the $mypg is always null. 
> 
> Why is that? Can you try and make it work on your end and let me know what

> the correction is?
> Thanks,
> QV
> 
> "Vikash Jain [MSFT]" wrote:
> 
> > Hi,
> > The reason for the error you see is that, the Rename-ProtectionGroup 
> > commandlet expects a ProtectionGroup object as parameter and you are
passing 
> > a string as input.
> > 
> > The correct usage would be
> > $pglist = Get-ProtectionGroup -DPMServerName <DPMServerName>
> > $mypg = $pglist | where-object {$_.Name -like "R3DEVDB"}
> > Rename-ProtectionGroup -ProtectionGroup $mypg -NewName R3DEVDB1
> > 
> > Please let me know if this does not solve your issue.
> > 
> > Thanks,
> > Vikash [MSFT]
> > 
> > This posting is provided "AS IS" with no warranties, and
confers no rights
> > 
> > "qvalor" <qvalor@discussions.microsoft.com> wrote in
message 
> > news:6BF188D5-EFA6-4C34-8EE2-C949146C4C69@microsoft.com...
> > > Hi,
> > >
> > > I wat to run a simple one line command. Example:
> > >
> > > Rename-ProtectionGroup -ProtectionGroup R3DEVDB -NewName
R3DEVDB1.
> > >
> > > But all I get are errors. What am I doing wrong?
> > >
> > > Here are the errors:
> > >
> > > Rename-ProtectionGroup : Cannot bind parameter 'ProtectionGroup'.
Cannot
> > > convert value "R3DEVDB" to type
"Microsoft.Internal
> > >
.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup". Error:
> > > "Invalid cast from 'System.String' to 'Microsoft.Int
> > >
ernal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup'."
> > > At line:1 char:40
> > > + Rename-ProtectionGroup -ProtectionGroup  <<<<
R3DEVDB -NewName R3DEVDB1 
> > 
> > 
Post Reply
Re: DPM Powershell not working
Sat, 12 Apr 2008 10:29:59 +053
Hi,
The reason for the error you see is that, the Rename-ProtectionGroup 
commandlet expects a ProtectionGroup object as parameter and you are passing 
a string as input.

The correct usage would be
$pglist = Get-ProtectionGroup -DPMServerName <DPMServerName>
$mypg = $pglist | where-object {$_.Name -like "R3DEVDB"}
Rename-ProtectionGroup -ProtectionGroup $mypg -NewName R3DEVDB1

Please let me know if this does not solve your issue.

Thanks,
Vikash [MSFT]

This posting is provided "AS IS" with no warranties, and confers no
rights

"qvalor" <qvalor@discussions.microsoft.com> wrote in message 
news:6BF188D5-EFA6-4C34-8EE2-C949146C4C69@microsoft.com...
> Hi,
>
> I wat to run a simple one line command. Example:
>
> Rename-ProtectionGroup -ProtectionGroup R3DEVDB -NewName R3DEVDB1.
>
> But all I get are errors. What am I doing wrong?
>
> Here are the errors:
>
> Rename-ProtectionGroup : Cannot bind parameter 'ProtectionGroup'. Cannot
> convert value "R3DEVDB" to type "Microsoft.Internal
> .EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup".
Error:
> "Invalid cast from 'System.String' to 'Microsoft.Int
>
ernal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup'."
> At line:1 char:40
> + Rename-ProtectionGroup -ProtectionGroup  <<<< R3DEVDB
-NewName R3DEVDB1 

Post Reply
Re: DPM Powershell not working
Sat, 12 Apr 2008 11:51:38 +053
Hi,

Before running any cmdlet you can use it's help to know what exactly you 
need to pass as parameters and how to use it.
If you will call it with -Full you'll see the example as well as the 
explanation of each parameters to pass.

To get full help type

Get-Help <cmdlet> -full

Get-Help  Rename-ProtectionGroup -full

in your case it would be

-- 
Thanks
Mukul

This posting is provided "AS IS" with no warranties, and confers no
rights
"qvalor" <qvalor@discussions.microsoft.com> wrote in message 
news:6BF188D5-EFA6-4C34-8EE2-C949146C4C69@microsoft.com...
> Hi,
>
> I wat to run a simple one line command. Example:
>
> Rename-ProtectionGroup -ProtectionGroup R3DEVDB -NewName R3DEVDB1.
>
> But all I get are errors. What am I doing wrong?
>
> Here are the errors:
>
> Rename-ProtectionGroup : Cannot bind parameter 'ProtectionGroup'. Cannot
> convert value "R3DEVDB" to type "Microsoft.Internal
> .EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup".
Error:
> "Invalid cast from 'System.String' to 'Microsoft.Int
>
ernal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup'."
> At line:1 char:40
> + Rename-ProtectionGroup -ProtectionGroup  <<<< R3DEVDB
-NewName R3DEVDB1 

Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact