- This topic has 5 replies, 3 voices, and was last updated 6 months, 3 weeks ago by
May 5, 2020 at 9:21 am #225663
I have a strange issue with PowerShell and the AIP module (Azure Information Protection), and I don’t find the solution.
I have a service account that I use to encrypt documents on the fly that are uploaded to an FTP server installed on Windows.
For this I use a token created on Azure which allows not to authenticate each time I launch the script.
The scenario is as follows:
– The service for FTP is launched with the service account
– A user uploads a file to the FTP
– The FTP server automatically launches a script and encrypts the document
This method works for two servers, so I can validate that my script works perfectly. However, for another server, I get this error:
Get-AIPFileStatus: The term 'Get-AIPFileStatus' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
However, when I start the script manually with this account, I have no problem. The error only occurs when the script is automatically launched by the FTP server.
I cannot understand why it does not recognize the command when it is clearly installed via the AIP module.
Someone have a miracle solution please ?
Thanks in advance.
May 5, 2020 at 4:29 pm #225777ParticipantTopics: 9Replies: 678Points: 2,683Rank: Community Hero
Sounds like you need to import the module in your script. If it’s already installed on the machine where the ftp script is running, just add import-module AIP near the beginning of the script to make those commands available. You could also use session configuration or profiles.
May 6, 2020 at 6:15 am #225885
May 6, 2020 at 6:30 pm #226122ParticipantTopics: 0Replies: 2Points: 31Rank: Member
Can you verify the module was imported? You might have to do run Install-Module AIP
May 7, 2020 at 6:32 am #226284
This module is automatically installed with the package Azure Information Protection :
I also installed these modules :
- Install-Module -Name AIPService
- Install-Module -Name AzureADPreview
I really insist that the script works perfectly when launched manually. The error only comes from when it is launched via the FTP server.
May 11, 2020 at 7:59 am #227176
I resolved my issue with the full path in my Import-Module command.
Import-Module “C:\Program Files (x86)\Microsoft Azure Information Protection\Powershell\AzureInformationProtection” -Force
- The topic ‘Cmdlet not recognized’ is closed to new replies.