# List Partitions Virtual Servers

**URL:** <https://community.f5.com/t/list-partitions-virtual-servers/24853>\
**Category:** Technical Forums\
**Tags:** icontrol, devops, microsoft-powershell-with-icontrol, microsoft\
**Created:** [January 20, 2011, 5:51pm UTC](https://community.f5.com/t/list-partitions-virtual-servers/24853 "2011-01-20T17:51:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joao\_Carmona\_41](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@Joao\_Carmona\_41](https://community.f5.com/u/Joao_Carmona_41)\
**Post date:** [January 20, 2011, 5:51pm UTC](https://community.f5.com/t/list-partitions-virtual-servers/24853/1 "2011-01-20T17:51:13Z")

</div>

Hi Joe,

I just installed the powershell icontrolSnapin and all the common commands works fine. My problem is that my Big-Ip device have 5 partitions (plus the common), and all Virtual Servers are in that 5 partitions.

I can get/list the partitions, but i didn’t figured out how to get the virtual servers from that partitions.

For listing the partitions i’m using:

(Get-F5.iControl).ManagementPartition.get\_partition\_list();

I was looking on the icontrol samples for some help, and the PS Partition Access Sample caught my attention:

(Get-F5.iContro).ManagementPartition.set\_active\_partition(“Partition1”);

If i activate a partition, when I do a list Pools, i’m going to get the ones from that partition (Partition1)?

(Get-F5.iControl).LocalLBPool.get\_list();

This is a production environment, so I don’t want to mess the things Up.

One final Note, you should include the [http://devcentral.f5.com/wiki/default.aspx/iControl/PowerShellSetupSnapin.html](http://devcentral.f5.com/wiki/default.aspx/iControl/PowerShellSetupSnapin.html), on the setup/install file. It works pretty well on Windows 2008 R2.

Best Regards,

João Carmona

---

<div class="post-metadata">

**Author:** ![Joe\_Pruitt](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/joe_pruitt/32/8438_2.png) [@Joe\_Pruitt](https://community.f5.com/u/Joe_Pruitt)\
**Post date:** [January 20, 2011, 6:37pm UTC](https://community.f5.com/t/list-partitions-virtual-servers/24853/2 "2011-01-20T18:37:47Z")

</div>

You are using the right logic. A call to set\_active\_partition() will change the context to the specified partition for the current user. This value is a persistent server side value that stays constant until a LTM restart. So, you should only have to call it once before making your calls for that specific partition.

The one thing you didn’t specify, so I’ll make sure you are aware of it. You can call the get\_user\_permission() method in the Management.UserManagement interface to get a list of partitions the current user has access to and what their role is for that given partition. This way you can determine which partition from the values returned from the get\_partition\_list() method you have rights to access.

Let me know if this doesn’t make sense…

-Joe

---

<div class="post-metadata">

**Author:** ![Joao\_Carmona\_41](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@Joao\_Carmona\_41](https://community.f5.com/u/Joao_Carmona_41)\
**Post date:** [January 21, 2011, 5:01pm UTC](https://community.f5.com/t/list-partitions-virtual-servers/24853/3 "2011-01-21T17:01:43Z")

</div>

Thanks Joe, it makes a lot of sense.

It worked, but I a strange behavior (or i think is strange). It’s a smal thing.

For testing I created a new user, and gave him Manager role in only onePartition. Through the webUI, i can only see that only that partition, but in powershell i can list all the Partitions. In fact my active partition was the “Common”. Is this normal?

Regarding my problem:

I used the set\_active\_partition to set the partition that I want to work it. Than I was able to list all the Partition Pool list, all Partition Virtual Servers… well until now i can see everything from the desire partition.

Thank you for your help.

João Carmona
