Skip to content

Commit 35ec70c

Browse files
author
Hovsep Mkrtchyan
committed
Added resource cmdlets.
1 parent 6d2d784 commit 35ec70c

File tree

118 files changed

+25528
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+25528
-25
lines changed

src/CLU/CLUCoreCLR.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.23107.0
4+
VisualStudioVersion = 14.0.24711.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.Common", "Commands.Common\Commands.Common.xproj", "{5F567ACA-595E-436D-83DB-A21E08F82DF6}"
77
EndProject
@@ -17,6 +17,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Pr
1717
EndProject
1818
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.ScenarioTests.ResourceManager.Common", "Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.xproj", "{9D1F91E1-B319-4914-B09B-60070C5531C7}"
1919
EndProject
20+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Resources", "Microsoft.Azure.Commands.Resources\Microsoft.Azure.Commands.Resources.xproj", "{99B1290D-A073-4907-8018-51C714431778}"
21+
EndProject
2022
Global
2123
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2224
Debug|Any CPU = Debug|Any CPU
@@ -51,6 +53,10 @@ Global
5153
{9D1F91E1-B319-4914-B09B-60070C5531C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
5254
{9D1F91E1-B319-4914-B09B-60070C5531C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
5355
{9D1F91E1-B319-4914-B09B-60070C5531C7}.Release|Any CPU.Build.0 = Release|Any CPU
56+
{99B1290D-A073-4907-8018-51C714431778}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57+
{99B1290D-A073-4907-8018-51C714431778}.Debug|Any CPU.Build.0 = Debug|Any CPU
58+
{99B1290D-A073-4907-8018-51C714431778}.Release|Any CPU.ActiveCfg = Release|Any CPU
59+
{99B1290D-A073-4907-8018-51C714431778}.Release|Any CPU.Build.0 = Release|Any CPU
5460
EndGlobalSection
5561
GlobalSection(SolutionProperties) = preSolution
5662
HideSolutionNode = FALSE

src/CLU/Commands.ResourceManager.Cmdlets/Properties/Resources.Designer.cs

Lines changed: 0 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CLU/Commands.ResourceManager.Cmdlets/Properties/Resources.resx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,6 @@
126126
<data name="InvalidTagFormatNotUniqueName" xml:space="preserve">
127127
<value>Invalid tag format. Ensure that each tag has a unique name. Example: @{Name = "tagName1"; Value = "tagValue1"}, @{Name = "tagName2"; Value = "tagValue2"}</value>
128128
</data>
129-
<data name="RemoveTagMessage" xml:space="preserve">
130-
<value>Removing tag ....</value>
131-
</data>
132-
<data name="RemovingTag" xml:space="preserve">
133-
<value>Are you sure you want to remove tag '{0}'</value>
134-
</data>
135129
<data name="TagNotFoundMessage" xml:space="preserve">
136130
<value>Tag '{0}' not found</value>
137131
</data>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.ActiveDirectory.Models;
16+
using Microsoft.Azure.Commands.Resources.Models.ActiveDirectory;
17+
using System;
18+
using System.Collections.Generic;
19+
using System.Management.Automation;
20+
21+
namespace Microsoft.Azure.Commands.ActiveDirectory
22+
{
23+
/// <summary>
24+
/// Get AD groups.
25+
/// </summary>
26+
[Cmdlet(VerbsCommon.Get, "AzureRmADGroup", DefaultParameterSetName = ParameterSet.Empty), OutputType(typeof(List<PSADGroup>))]
27+
public class GetAzureADGroupCommand : ActiveDirectoryBaseCmdlet
28+
{
29+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.SearchString,
30+
HelpMessage = "The user or group name.")]
31+
[ValidateNotNullOrEmpty]
32+
public string SearchString { get; set; }
33+
34+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.Empty,
35+
HelpMessage = "The group id.")]
36+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ObjectId,
37+
HelpMessage = "The group id.")]
38+
[ValidateNotNullOrEmpty]
39+
public Guid ObjectId { get; set; }
40+
41+
protected override void ProcessRecord()
42+
{
43+
ADObjectFilterOptions options = new ADObjectFilterOptions
44+
{
45+
SearchString = SearchString,
46+
Id = ObjectId == Guid.Empty ? null : ObjectId.ToString(),
47+
Paging = true
48+
};
49+
50+
do
51+
{
52+
WriteObject(ActiveDirectoryClient.FilterGroups(options), true);
53+
} while (!string.IsNullOrEmpty(options.NextLink));
54+
}
55+
}
56+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.ActiveDirectory.Models;
16+
using Microsoft.Azure.Commands.Resources.Models.ActiveDirectory;
17+
using System;
18+
using System.Collections.Generic;
19+
using System.Management.Automation;
20+
21+
namespace Microsoft.Azure.Commands.ActiveDirectory
22+
{
23+
/// <summary>
24+
/// Get AD groups members.
25+
/// </summary>
26+
[Cmdlet(VerbsCommon.Get, "AzureRmADGroupMember", DefaultParameterSetName = ParameterSet.Empty), OutputType(typeof(List<PSADObject>))]
27+
public class GetAzureADGroupMemberCommand : ActiveDirectoryBaseCmdlet
28+
{
29+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The user email address.")]
30+
[ValidateNotNullOrEmpty]
31+
public Guid GroupObjectId { get; set; }
32+
33+
protected override void ProcessRecord()
34+
{
35+
ADObjectFilterOptions options = new ADObjectFilterOptions
36+
{
37+
Id = GroupObjectId == Guid.Empty ? null : GroupObjectId.ToString(),
38+
Paging = true
39+
};
40+
41+
do
42+
{
43+
WriteObject(ActiveDirectoryClient.GetGroupMembers(options), true);
44+
} while (!string.IsNullOrEmpty(options.NextLink));
45+
}
46+
}
47+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.ActiveDirectory.Models;
16+
using Microsoft.Azure.Commands.Resources.Models.ActiveDirectory;
17+
using System;
18+
using System.Collections.Generic;
19+
using System.Management.Automation;
20+
21+
namespace Microsoft.Azure.Commands.ActiveDirectory
22+
{
23+
/// <summary>
24+
/// Get AD users.
25+
/// </summary>
26+
[Cmdlet(VerbsCommon.Get, "AzureRmADServicePrincipal", DefaultParameterSetName = ParameterSet.Empty), OutputType(typeof(List<PSADServicePrincipal>))]
27+
public class GetAzureADServicePrincipalCommand : ActiveDirectoryBaseCmdlet
28+
{
29+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.SearchString,
30+
HelpMessage = "The service principal search string.")]
31+
[ValidateNotNullOrEmpty]
32+
public string SearchString { get; set; }
33+
34+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ObjectId,
35+
HelpMessage = "The service principal object id.")]
36+
[ValidateNotNullOrEmpty]
37+
public Guid ObjectId { get; set; }
38+
39+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.Empty,
40+
HelpMessage = "The user SPN.")]
41+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.SPN,
42+
HelpMessage = "The user SPN.")]
43+
[ValidateNotNullOrEmpty]
44+
[Alias("SPN")]
45+
public string ServicePrincipalName { get; set; }
46+
47+
protected override void ProcessRecord()
48+
{
49+
ADObjectFilterOptions options = new ADObjectFilterOptions
50+
{
51+
SearchString = SearchString,
52+
SPN = ServicePrincipalName,
53+
Id = ObjectId == Guid.Empty ? null : ObjectId.ToString(),
54+
Paging = true
55+
};
56+
57+
do
58+
{
59+
WriteObject(ActiveDirectoryClient.FilterServicePrincipals(options), true);
60+
61+
} while (!string.IsNullOrEmpty(options.NextLink));
62+
}
63+
}
64+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using Microsoft.Azure.Commands.ActiveDirectory.Models;
16+
using Microsoft.Azure.Commands.Resources.Models.ActiveDirectory;
17+
using System;
18+
using System.Collections.Generic;
19+
using System.Management.Automation;
20+
21+
namespace Microsoft.Azure.Commands.ActiveDirectory
22+
{
23+
/// <summary>
24+
/// Get AD users.
25+
/// </summary>
26+
[Cmdlet(VerbsCommon.Get, "AzureRmADUser", DefaultParameterSetName = ParameterSet.Empty), OutputType(typeof(List<PSADUser>))]
27+
public class GetAzureADUserCommand : ActiveDirectoryBaseCmdlet
28+
{
29+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.SearchString,
30+
HelpMessage = "The user search string.")]
31+
[ValidateNotNullOrEmpty]
32+
public string SearchString { get; set; }
33+
34+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.ObjectId,
35+
HelpMessage = "The user object id.")]
36+
[ValidateNotNullOrEmpty]
37+
public Guid ObjectId { get; set; }
38+
39+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.Empty,
40+
HelpMessage = "The user UPN.")]
41+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.UPN,
42+
HelpMessage = "The user UPN.")]
43+
[ValidateNotNullOrEmpty]
44+
[Alias("UPN")]
45+
public string UserPrincipalName { get; set; }
46+
47+
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, ParameterSetName = ParameterSet.Mail,
48+
HelpMessage = "The user mail.")]
49+
[ValidateNotNullOrEmpty]
50+
public string Mail { get; set; }
51+
52+
protected override void ProcessRecord()
53+
{
54+
ADObjectFilterOptions options = new ADObjectFilterOptions
55+
{
56+
SearchString = SearchString,
57+
UPN = UserPrincipalName,
58+
Id = ObjectId == Guid.Empty ? null : ObjectId.ToString(),
59+
Paging = true,
60+
Mail = Mail
61+
};
62+
63+
do
64+
{
65+
WriteObject(ActiveDirectoryClient.FilterUsers(options), true);
66+
67+
} while (!string.IsNullOrEmpty(options.NextLink));
68+
}
69+
}
70+
}

0 commit comments

Comments
 (0)