Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File shares info not writing to IT Glue, much like was happening with the AD one #13

Open
jfpcc opened this issue Oct 9, 2018 · 7 comments

Comments

@jfpcc
Copy link

jfpcc commented Oct 9, 2018

There seems to have been an update to the ActiveDirectory.ps1 with the new Initialize-ActiveDirectoryFlexAsset.ps1 command being recently introduced. Is that accurate?
Prior, trying the ActiveDirectory.ps1 ran fine but it never updated IT Glue. Now that this new command to ensure the AD Flex Asset is properly created, it runs just fine.

I'm having the same issues with the FileShares.ps1. It seems to be grabbing all the correct info about file shares on the server that is run, but never actually writes to IT Glue and gives no error. Any suggestions?

image

I'll have a peak at the Initialize-ActiveDirectoryFlexAsset.ps1 code in the meantime.

Thanks,

@ckortenhorst
Copy link

I am getting no errors just showing me in green under each share

File Shares flex asset configuration file found!

But nothing showing in IT-Glue

@theonlytruebigmac
Copy link

Same thing is happening to me, anything new in here?

@mikekanet
Copy link

It appears that it wasn't passing the org_id information to the correct part of the script. I was able to force it to work by changing line 232 in the FileShares.ps1 script to be as follows:
$api__org_id = "nnnnnn"
You would need to manually enter your org id in place of nnnnnn. Once I manually put in the org_id it worked for me. Now the only problem is that if I run it more than one time it duplicates the file shares, instead of updating. Any guidance on that would be great.

@ni82156
Copy link

ni82156 commented Mar 8, 2019

Mikekanet, after I make that change I get the error

C:\fileshares\FileShares.ps1 : ERROR: File Shares flex asset configuration file was found. Please create one and
re-run the script.
At line:1 char:1

  • .\FileShares.ps1 -api api_config-FileShares.psd1 -organization "xxxx"
  •   + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,FileShares.ps1
    

@ni82156
Copy link

ni82156 commented Mar 8, 2019

Nevermind, figured out the solve for my earlier comment but still not working overall. Everything is green it just doesn't put the data in IT Glue

@Absoblogginlutely
Copy link

There are a couple of bugs in the fileshares.ps1 file but after fixing those so I have correct data I now get
New-ITGlueFlexibleAssets : {"errors":[{"status":401,"title":"Unauthorized","detail":"Unauthorized resource
access","source":{"pointer":"id"}}]}
At C:\jobs\itglue\FileShares.ps1:245 char:49

  • ... $api__output_data = New-ITGlueFlexibleAssets -data $api__body
  •                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-ITGlueFlexibleAssets

Code is currently
$api__body = formatAPIData # format data for API call $api__org_id = $api__body.data.attributes.organization_id $api__flex_asset_id = $api_config.flex_asset_id

Should be
$api__body = formatAPIData # format data for API call #$api__org_id = $api__body.data.attributes.organization_id $api__org_id = $api__body.attributes.organization_id #$api__flex_asset_id = $api_config.flex_asset_id $api__flex_asset_id = $api_config.flexible_asset_type_id
This will at least now poplate api__body. Looking as to why this is unauthorised?

@Absoblogginlutely
Copy link

I also found a couple of instances for the server/diskpath where it looks like the code was expecting the routine to be run against multiple machines. However the samples /command line show it being run against one machine. As a result, looping through server results in referencing an array when there is only one value so $currentserver=$server[$i] ends up as a null value instead of the current server name.
The same can be said with the diskpath.

After I changed the above, i still find that the $api__body.attributes.traits.servers is blank after the $api_body = formatapidata is called. At that point $post has the server name in it, but the server gets lost when api_body is created.
I manually set it in the script but I'm still getting the unauthorised resource access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants