Cmdlet not recognized

Welcome Forums General PowerShell Q&A Cmdlet not recognized

Viewing 5 reply threads
  • Author
    Posts
    • #225663
      Participant
      Topics: 1
      Replies: 3
      Points: 21
      Rank: Member

      Hello everyone,

      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
      again.

      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.

    • #225777
      Participant
      Topics: 9
      Replies: 678
      Points: 2,683
      Helping Hand
      Rank: 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.

    • #225885
      Participant
      Topics: 1
      Replies: 3
      Points: 21
      Rank: Member

      Hello Doug,

      I’ve already added this in the begining of my script with no result… Always the same issue.

    • #226122
      Participant
      Topics: 0
      Replies: 2
      Points: 31
      Rank: Member

      Can you verify the module was imported?  You might have to do run Install-Module AIP

    • #226284
      Participant
      Topics: 1
      Replies: 3
      Points: 21
      Rank: Member

      Hello Amar,

      This module is automatically installed with the package Azure Information Protection :
      https://www.microsoft.com/en-us/download/details.aspx?id=53018

      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.

    • #227176
      Participant
      Topics: 1
      Replies: 3
      Points: 21
      Rank: Member

      Hello,

      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

      Thanks.

Viewing 5 reply threads
  • The topic ‘Cmdlet not recognized’ is closed to new replies.