Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise Design Integration Forum change folder environment in batch
    • Sign In

    • State Suggested Answer
    • +1 person also asked this people also asked this
    • Replies 9 replies
    • Answers 1 answer
    • Subscribers 65 subscribers
    • Views 5298 views
    • Users 0 members are here

    change folder environment in batch

    Luc Poulin
    Offline Luc Poulin over 7 years ago

    Hi All

    I wanted to delete an environment, but i suspect i can't because it is being used by folders

    I find the folders using this specific envrionment, However I have 1000 of those folders....

    Any tool to change in batch the environment associate to a folder? or we still rely on the one by one method?

    • Sign in to reply
    • Cancel
    • Franky Riphung
      0 Offline Franky Riphung Thu, Jan 5 2017 3:40 AM
      Hi Luc,

      Greetings!!!
      Are you trying to change the Environment from one to another? Or just delete?
      It's important to know that deleting an Environment will result in deletion of all the attributes which has been created for that particular Environment.
      .........................................................................................................................

      Currently, we don't have a specific tool as you require but we do have the PWEXPT & PWIMPT Utility which you can use\try. The Utility can be found under - C:\Program Files (x86)\Bentley\ProjectWise\bin. You will be able to select Multiple folders for Export\Import,
      also if you open the Exported file (.AAM Extension) in a Notepad it will give you additional information.

      I suggest you try this tool on a folder or two & update.

      Thanks
      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Paul Patterson
      0 Offline Paul Patterson Thu, Jan 5 2017 8:13 AM

      Powershell is your friend here.

      You'll likely need to reach out to one of the Bentley folks to get the additional extensions..

      I've pasted the contents of my ps1 file below.. unfortunately, I've lost all my tab indexes, so it looks a bit gnarly.

      Warning! Dragons ahead! Use at your own risk! If there's any uncertainty of the code below, stop, take a deep breath, and ask for help! I had this one saved from a long time ago.. be sure to test in a sandbox environment first! Also - unsure how this will act on folders that have documents in them.. I likely just tested this on empty folders. 

      Paul

      --------------------------------------------------------------------------------------------------------------------------------------------------------------

      <#======================================================================================+
      |
      | Apply Environment to a folder, and subfolders 
      | P. Patterson
      | Note: Functions must be defined before calling them.
      +======================================================================================#>

      #--------------------------------------------------------------------------------------#
      #Import Modules .. these locations have changed recently
      #---------------------------------------------------------------------------------------#

      Import-Module -Name "C:\Program Files (x86)\Bentley\ProjectWise\bin\PowerShell\pwps\PWPS.dll" -Verbose
      Import-Module -Name "C:\Program Files (x86)\Bentley\ProjectWise\bin\PowerShell\pwps\PWPS_DAB.dll" -Verbose

      #-------------------------------------#
      # Prefs
      #-------------------------------------#

      # Stop this script if there are any errors
      $ErrorActionPreference = 'Stop'
      # Write out all debug and verbose messages
      $DebugPreference = 'Continue'
      $VerbosePreference = 'Continue'


      #Credentials - change to suit
      $ProjectWise = 'integrationserver:datasource_name';
      $username = 'domain\username';
      $password = 'password';

      # Open an Admin Connection - Probably not required for changing environments..but whatever.

      Open-PWConnection -Admin -DatasourceName $ProjectWise -UserName $username -Password $password

      # Echo what we're logging into

      write-host $ProjectWise


      Set-PWEnvironmentByFolderPath -FolderPath "0-Paul" -Environment 'Environment_Name' -SubFolders

      Close-PWConnection

      #Always cleanup the function
      Remove-Variable ProjectWise
      Remove-Variable username
      Remove-Variable password

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Reject Answer
      • Cancel
    • Peter Willmen
      0 Offline Peter Willmen Thu, Jan 5 2017 8:32 AM in reply to Paul Patterson
      Where can I get these 'Additional' extensions (PWPS_DAB.dll)?
      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Franky Riphung
      0 Offline Franky Riphung Thu, Jan 5 2017 11:44 PM in reply to Peter Willmen

      Kindly raise a Service Request

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Luc Poulin
      0 Offline Luc Poulin Mon, Jan 9 2017 11:54 AM in reply to Paul Patterson
      Thank you, unfortunately, i'm not knowledgeable about prowershell....
      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    >

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies