Can't set the StgBlockSize option on a just created job

PowerShell script exchange

Can't set the StgBlockSize option on a just created job

Veeam Logoby Amerloc » Mon Oct 08, 2012 4:30 pm

I create a new job via Powershell script and the next step is to load job options in a variable called $jobopt and then setting the $jobopt.Options.RootNode.StgBlockSize = "KbBlockSize512". But when this command runs, the following error appears:
"Property 'StgBlockSize' cannot be found on this object; make sure it exists and is settable
At C:\creabackup.ps1:15 char:26
+ $jobopt.Options.RootNode. <<<< StgBlockSize = "KbBlockSize512"
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException"

If I type $jobopt.Options.RootNode, all I get is this:

Name : JobOptionsRoot
LocalName : JobOptionsRoot
NamespaceURI :
Prefix :
NodeType : Element
ParentNode : #document
OwnerDocument : #document
IsEmpty : True
Attributes : {}
HasAttributes : False
SchemaInfo : System.Xml.XmlName
InnerXml :
InnerText :
NextSibling :
PreviousSibling :
Value :
ChildNodes : {}
FirstChild :
LastChild :
HasChildNodes : False
IsReadOnly : False
OuterXml : <JobOptionsRoot />
BaseURI :

Seems like the xml field related to job options is not populated.

If I go to the GUI, edit job's properties and click finish, then I can set the StgBlockSize option via powershell using the previous command.
┬┐Is there a way to do the same that is done when I edit the job and click finish via powershell?

Thanks.
Amerloc
Influencer
 
Posts: 12
Liked: 1 time
Joined: Thu Mar 08, 2012 9:26 am
Full Name: Adolfo Alvarez

Re: Can't set the StgBlockSize option on a just created job

Veeam Logoby tsightler » Mon Oct 08, 2012 4:32 pm 1 person likes this post

Code: Select all
$jobopt.BackupStorageOptions.StgBlockSize = "KbBlockSize512"
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Can't set the StgBlockSize option on a just created job

Veeam Logoby Amerloc » Mon Oct 08, 2012 5:34 pm

Thanks a lot tsightler. Too many hours working :-)
Amerloc
Influencer
 
Posts: 12
Liked: 1 time
Joined: Thu Mar 08, 2012 9:26 am
Full Name: Adolfo Alvarez


Return to PowerShell



Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 7 guests