Example #1
0
		public static void ToDirectoryGroupCategory(string extendedAttribute, string[] directoryAttributes, ADPropertyValueCollection extendedData, ADEntity directoryObj, CmdletSessionInfo cmdletSessionInfo)
		{
			ADGroupCategory aDGroupCategory = ADGroupCategory.Distribution;
			if (extendedData != null)
			{
				if (extendedData.Value != null)
				{
					ADGroupCategory value = (ADGroupCategory)extendedData.Value;
					int directoryGroupTypeValue = GroupTypeUtils.GetDirectoryGroupTypeValue(value);
					if (!directoryObj.Contains(directoryAttributes[0]))
					{
						directoryObj.Add(directoryAttributes[0], directoryGroupTypeValue);
					}
					else
					{
						int num = (int)directoryObj[directoryAttributes[0]].Value;
						if (GroupTypeUtils.TryGetExtendedGroupCategoryValue(num, out aDGroupCategory))
						{
							int directoryGroupTypeValue1 = GroupTypeUtils.GetDirectoryGroupTypeValue(aDGroupCategory);
							num = num & ~directoryGroupTypeValue1;
						}
						directoryObj[directoryAttributes[0]].Value = num + directoryGroupTypeValue;
						return;
					}
				}
				else
				{
					return;
				}
			}
		}
Example #2
0
		public static void ToExtendedGroupCategory(string extendedAttribute, string[] directoryAttributes, ADEntity userObj, ADEntity directoryObj, CmdletSessionInfo cmdletSessionInfo)
		{
			if (!directoryObj.Contains(directoryAttributes[0]))
			{
				userObj.Add(extendedAttribute, new ADPropertyValueCollection(null));
				return;
			}
			else
			{
				int value = (int)directoryObj[directoryAttributes[0]].Value;
				if ((value & -2147483648) != -2147483648)
				{
					userObj.Add(extendedAttribute, ADGroupCategory.Distribution);
					return;
				}
				else
				{
					userObj.Add(extendedAttribute, ADGroupCategory.Security);
					return;
				}
			}
		}
Example #3
0
		public static void ToExtendedGroupScope(string extendedAttribute, string[] directoryAttributes, ADEntity userObj, ADEntity directoryObj, CmdletSessionInfo cmdletSessionInfo)
		{
			if (!directoryObj.Contains(directoryAttributes[0]))
			{
				userObj.Add(extendedAttribute, new ADPropertyValueCollection(null));
			}
			else
			{
				int value = (int)directoryObj[directoryAttributes[0]].Value;
				if ((value & 4) != 4)
				{
					if ((value & 2) != 2)
					{
						if ((value & 8) == 8)
						{
							userObj.Add(extendedAttribute, ADGroupScope.Universal);
							return;
						}
					}
					else
					{
						userObj.Add(extendedAttribute, ADGroupScope.Global);
						return;
					}
				}
				else
				{
					userObj.Add(extendedAttribute, ADGroupScope.DomainLocal);
					return;
				}
			}
		}
Example #4
0
		internal static void ToExtendedGPLink(string extendedAttribute, string[] directoryAttributes, ADEntity userObj, ADEntity directoryObj, CmdletSessionInfo cmdletSessionInfo)
		{
			if (!directoryObj.Contains(directoryAttributes[0]))
			{
				userObj.Add(extendedAttribute, new ADPropertyValueCollection());
				return;
			}
			else
			{
				string value = directoryObj[directoryAttributes[0]].Value as string;
				userObj.Add(extendedAttribute, GPLinkUtil.ConvertLinkedGroupPolicyObjects(value));
				return;
			}
		}