Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 01afc97eb4ef228c1d70e09919fb1ff67cc07fc8 0 parents
David Ryder authored
Showing with 42,313 additions and 0 deletions.
  1. +20 −0 ActiveDirectoryTools.sln
  2. BIN  ActiveDirectoryTools.suo
  3. +376 −0 ActiveDirectoryTools/ActiveDirectoryTools.csproj
  4. +16 −0 ActiveDirectoryTools/ActiveDirectoryTools.csproj.user
  5. BIN  ActiveDirectoryTools/ActiveDirectoryTools_TemporaryKey.pfx
  6. +15 −0 ActiveDirectoryTools/Classes/AvayaControl.cs
  7. +53 −0 ActiveDirectoryTools/Classes/Cleanup.cs
  8. +454 −0 ActiveDirectoryTools/Classes/DirectoryReport.cs
  9. +48 −0 ActiveDirectoryTools/Classes/DiskCleanUp.cs
  10. +30 −0 ActiveDirectoryTools/Classes/DomainTools.cs
  11. +58 −0 ActiveDirectoryTools/Classes/ExcelWorkSheet.cs
  12. +129 −0 ActiveDirectoryTools/Classes/ExchangeMgmt.cs
  13. +135 −0 ActiveDirectoryTools/Classes/ListViewColumnSorter.cs
  14. +53 −0 ActiveDirectoryTools/Classes/Program.cs
  15. +76 −0 ActiveDirectoryTools/Classes/RegistryControl.cs
  16. +462 −0 ActiveDirectoryTools/Classes/RemoteConnect.cs
  17. +43 −0 ActiveDirectoryTools/Classes/Settings.cs
  18. +1,083 −0 ActiveDirectoryTools/Classes/UserControls.cs
  19. +1,724 −0 ActiveDirectoryTools/CompDATADataSet.Designer.cs
  20. +1 −0  ActiveDirectoryTools/CompDATADataSet.xsc
  21. +169 −0 ActiveDirectoryTools/CompDATADataSet.xsd
  22. +12 −0 ActiveDirectoryTools/CompDATADataSet.xss
  23. +50 −0 ActiveDirectoryTools/DefaultSettings.Designer.cs
  24. +12 −0 ActiveDirectoryTools/DefaultSettings.settings
  25. +140 −0 ActiveDirectoryTools/Forms/AdminExplorer.Designer.cs
  26. +83 −0 ActiveDirectoryTools/Forms/AdminExplorer.cs
  27. +4,915 −0 ActiveDirectoryTools/Forms/AdminExplorer.resx
  28. +88 −0 ActiveDirectoryTools/Forms/AdvancedSearch.Designer.cs
  29. +39 −0 ActiveDirectoryTools/Forms/AdvancedSearch.cs
  30. +120 −0 ActiveDirectoryTools/Forms/AdvancedSearch.resx
  31. +242 −0 ActiveDirectoryTools/Forms/CopyUser.Designer.cs
  32. +99 −0 ActiveDirectoryTools/Forms/CopyUser.cs
  33. +120 −0 ActiveDirectoryTools/Forms/CopyUser.resx
  34. +191 −0 ActiveDirectoryTools/Forms/FindRep.Designer.cs
  35. +97 −0 ActiveDirectoryTools/Forms/FindRep.cs
  36. +120 −0 ActiveDirectoryTools/Forms/FindRep.resx
  37. +87 −0 ActiveDirectoryTools/Forms/GetTextInput.Designer.cs
  38. +31 −0 ActiveDirectoryTools/Forms/GetTextInput.cs
  39. +122 −0 ActiveDirectoryTools/Forms/GetTextInput.resx
  40. +115 −0 ActiveDirectoryTools/Forms/GroupProperties.Designer.cs
  41. +81 −0 ActiveDirectoryTools/Forms/GroupProperties.cs
  42. +120 −0 ActiveDirectoryTools/Forms/GroupProperties.resx
  43. +2,175 −0 ActiveDirectoryTools/Forms/MainWindow.Designer.cs
  44. +2,079 −0 ActiveDirectoryTools/Forms/MainWindow.cs
  45. +4,981 −0 ActiveDirectoryTools/Forms/MainWindow.resx
  46. +384 −0 ActiveDirectoryTools/Forms/ObjectProperties.Designer.cs
  47. +224 −0 ActiveDirectoryTools/Forms/ObjectProperties.cs
  48. +4,918 −0 ActiveDirectoryTools/Forms/ObjectProperties.resx
  49. +179 −0 ActiveDirectoryTools/Forms/RunCleanup.Designer.cs
  50. +167 −0 ActiveDirectoryTools/Forms/RunCleanup.cs
  51. +4,921 −0 ActiveDirectoryTools/Forms/RunCleanup.resx
  52. +38 −0 ActiveDirectoryTools/Forms/SelectExchDatabase.Designer.cs
  53. +19 −0 ActiveDirectoryTools/Forms/SelectExchDatabase.cs
  54. +120 −0 ActiveDirectoryTools/Forms/SelectExchDatabase.resx
  55. +142 −0 ActiveDirectoryTools/Forms/SelectGroup.Designer.cs
  56. +80 −0 ActiveDirectoryTools/Forms/SelectGroup.cs
  57. +120 −0 ActiveDirectoryTools/Forms/SelectGroup.resx
  58. +134 −0 ActiveDirectoryTools/Forms/SelectUserForGroup.Designer.cs
  59. +86 −0 ActiveDirectoryTools/Forms/SelectUserForGroup.cs
  60. +123 −0 ActiveDirectoryTools/Forms/SelectUserForGroup.resx
  61. +138 −0 ActiveDirectoryTools/Forms/SetPassword.Designer.cs
  62. +66 −0 ActiveDirectoryTools/Forms/SetPassword.cs
  63. +120 −0 ActiveDirectoryTools/Forms/SetPassword.resx
  64. +145 −0 ActiveDirectoryTools/Forms/TermUser.Designer.cs
  65. +158 −0 ActiveDirectoryTools/Forms/TermUser.cs
  66. +123 −0 ActiveDirectoryTools/Forms/TermUser.resx
  67. +128 −0 ActiveDirectoryTools/Forms/inputAuthDialog.Designer.cs
  68. +54 −0 ActiveDirectoryTools/Forms/inputAuthDialog.cs
  69. +4,915 −0 ActiveDirectoryTools/Forms/inputAuthDialog.resx
  70. +36 −0 ActiveDirectoryTools/Properties/AssemblyInfo.cs
  71. +203 −0 ActiveDirectoryTools/Properties/Resources.Designer.cs
  72. +181 −0 ActiveDirectoryTools/Properties/Resources.resx
  73. +37 −0 ActiveDirectoryTools/Properties/Settings.Designer.cs
  74. +14 −0 ActiveDirectoryTools/Properties/Settings.settings
  75. +30 −0 ActiveDirectoryTools/Properties/app.manifest
  76. BIN  ActiveDirectoryTools/Resources/17-1.gif
  77. BIN  ActiveDirectoryTools/Resources/17-11.gif
  78. BIN  ActiveDirectoryTools/Resources/Full Logo 2008.PNG
  79. BIN  ActiveDirectoryTools/Resources/busy1.gif
  80. BIN  ActiveDirectoryTools/Resources/edit-clear.png
  81. BIN  ActiveDirectoryTools/Resources/edit-find.png
  82. BIN  ActiveDirectoryTools/Resources/emblem-readonly.png
  83. BIN  ActiveDirectoryTools/Resources/face-grin.png
  84. BIN  ActiveDirectoryTools/Resources/face-sad.png
  85. BIN  ActiveDirectoryTools/Resources/go-home.png
  86. BIN  ActiveDirectoryTools/Resources/go-next.png
  87. BIN  ActiveDirectoryTools/Resources/list-add.png
  88. BIN  ActiveDirectoryTools/Resources/network.ico
  89. BIN  ActiveDirectoryTools/Resources/process-stop.png
  90. BIN  ActiveDirectoryTools/Resources/progress.gif
  91. BIN  ActiveDirectoryTools/Resources/system-lock-screen.png
  92. BIN  ActiveDirectoryTools/Resources/system-users.png
  93. BIN  ActiveDirectoryTools/Resources/user-home.png
  94. BIN  ActiveDirectoryTools/Resources/window-new.png
  95. +23 −0 ActiveDirectoryTools/app.config
  96. +18 −0 ActiveDirectoryTools/bin/Debug/ActiveDirectoryTools.application
  97. BIN  ActiveDirectoryTools/bin/Debug/ActiveDirectoryTools.exe
  98. +23 −0 ActiveDirectoryTools/bin/Debug/ActiveDirectoryTools.exe.config
  99. +139 −0 ActiveDirectoryTools/bin/Debug/ActiveDirectoryTools.exe.manifest
  100. BIN  ActiveDirectoryTools/bin/Debug/ActiveDirectoryTools.pdb
  101. +18 −0 ActiveDirectoryTools/bin/Debug/ActiveDirectoryTools.vshost.application
  102. BIN  ActiveDirectoryTools/bin/Debug/ActiveDirectoryTools.vshost.exe
  103. +23 −0 ActiveDirectoryTools/bin/Debug/ActiveDirectoryTools.vshost.exe.config
  104. BIN  ActiveDirectoryTools/bin/Debug/Interop.ADODB.dll
  105. BIN  ActiveDirectoryTools/bin/Debug/Interop.Microsoft.Office.Core.dll
  106. BIN  ActiveDirectoryTools/bin/Debug/Interop.Microsoft.Office.Interop.Excel.dll
  107. BIN  ActiveDirectoryTools/bin/Debug/ServiceProvider.dll
  108. +11 −0 ActiveDirectoryTools/bin/Debug/WindowsFormsApplication1.vshost.exe.manifest
  109. 0  ActiveDirectoryTools/bin/Debug/computer_list.txt
  110. +18 −0 ActiveDirectoryTools/bin/Release/ActiveDirectoryTools.application
  111. BIN  ActiveDirectoryTools/bin/Release/ActiveDirectoryTools.exe
  112. +23 −0 ActiveDirectoryTools/bin/Release/ActiveDirectoryTools.exe.config
  113. +127 −0 ActiveDirectoryTools/bin/Release/ActiveDirectoryTools.exe.manifest
  114. BIN  ActiveDirectoryTools/bin/Release/ActiveDirectoryTools.pdb
  115. +18 −0 ActiveDirectoryTools/bin/Release/ActiveDirectoryTools.vshost.application
  116. BIN  ActiveDirectoryTools/bin/Release/ActiveDirectoryTools.vshost.exe
  117. +23 −0 ActiveDirectoryTools/bin/Release/ActiveDirectoryTools.vshost.exe.config
  118. BIN  ActiveDirectoryTools/bin/Release/Interop.Microsoft.Office.Core.dll
  119. BIN  ActiveDirectoryTools/bin/Release/Interop.Microsoft.Office.Interop.Excel.dll
  120. BIN  ActiveDirectoryTools/bin/Release/ServiceProvider.dll
  121. +18 −0 ActiveDirectoryTools/bin/Release/app.publish/ActiveDirectoryTools.application
  122. +23 −0 .../Release/app.publish/Application Files/ActiveDirectoryTools_2_0_0_63/ActiveDirectoryTools.exe.config.deploy
  123. BIN  ...ols/bin/Release/app.publish/Application Files/ActiveDirectoryTools_2_0_0_63/ActiveDirectoryTools.exe.deploy
  124. +139 −0 ...s/bin/Release/app.publish/Application Files/ActiveDirectoryTools_2_0_0_63/ActiveDirectoryTools.exe.manifest
  125. BIN  ...elease/app.publish/Application Files/ActiveDirectoryTools_2_0_0_63/Interop.Microsoft.Office.Core.dll.deploy
  126. BIN  ...p.publish/Application Files/ActiveDirectoryTools_2_0_0_63/Interop.Microsoft.Office.Interop.Excel.dll.deploy
  127. BIN  ...yTools/bin/Release/app.publish/Application Files/ActiveDirectoryTools_2_0_0_63/Resources/network.ico.deploy
  128. BIN  ...Tools/bin/Release/app.publish/Application Files/ActiveDirectoryTools_2_0_0_63/Resources/progress.gif.deploy
  129. BIN  ...oryTools/bin/Release/app.publish/Application Files/ActiveDirectoryTools_2_0_0_63/ServiceProvider.dll.deploy
  130. BIN  ActiveDirectoryTools/bin/Release/app.publish/setup.exe
  131. +924 −0 ActiveDirectoryTools/bin/Release/computer_list.txt
  132. BIN  ActiveDirectoryTools/bin/Release/psexec.exe
  133. +11 −0 ActiveDirectoryTools/bin/Release/tmp.txt
  134. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.AdvancedSearch.resources
  135. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.ElevateExplorer.resources
  136. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.Forms.CopyUser.resources
  137. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.Forms.FindRep.resources
  138. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.Forms.GetTextInput.resources
  139. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.Forms.RunCleanup.resources
  140. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.Forms.SelectExchDatabase.resources
  141. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.Forms.SelectGroup.resources
  142. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.Forms.SetPassword.resources
  143. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.Forms.TermUser.resources
  144. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.GroupProperties.resources
  145. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.MainWindow.resources
  146. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.ObjectProperties.resources
  147. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.Properties.Resources.resources
  148. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.SelectUserForGroup.resources
  149. +11 −0 ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.TrustInfo.xml
  150. +18 −0 ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.application
  151. +117 −0 ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.csproj.FileListAbsolute.txt
  152. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.csproj.GenerateResource.Cache
  153. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.csproj.ResolveComReference.cache
  154. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.exe
  155. +139 −0 ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.exe.manifest
  156. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.inputAuthDialog.resources
  157. BIN  ActiveDirectoryTools/obj/Debug/ActiveDirectoryTools.pdb
  158. BIN  ActiveDirectoryTools/obj/Debug/Interop.ADODB.dll
  159. BIN  ActiveDirectoryTools/obj/Debug/Interop.Microsoft.Office.Core.dll
  160. BIN  ActiveDirectoryTools/obj/Debug/Interop.Microsoft.Office.Interop.Excel.dll
  161. BIN  ActiveDirectoryTools/obj/Debug/Interop.VBIDE.dll
  162. BIN  ActiveDirectoryTools/obj/Debug/ResolveAssemblyReference.cache
  163. BIN  ActiveDirectoryTools/obj/Debug/TempPE/CompDATADataSet.Designer.cs.dll
  164. BIN  ActiveDirectoryTools/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll
  165. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.AdvancedSearch.resources
  166. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.ElevateExplorer.resources
  167. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.Forms.CopyUser.resources
  168. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.Forms.FindRep.resources
  169. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.Forms.GetTextInput.resources
  170. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.Forms.RunCleanup.resources
  171. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.Forms.SelectExchDatabase.resources
  172. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.Forms.SelectGroup.resources
  173. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.Forms.SetPassword.resources
  174. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.Forms.TermUser.resources
  175. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.GroupProperties.resources
  176. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.MainWindow.resources
  177. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.ObjectProperties.resources
  178. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.Properties.Resources.resources
  179. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.SelectUserForGroup.resources
  180. +11 −0 ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.TrustInfo.xml
  181. +18 −0 ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.application
  182. +147 −0 ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.csproj.FileListAbsolute.txt
  183. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.csproj.GenerateResource.Cache
  184. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.csproj.ResolveComReference.cache
  185. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.exe
  186. +127 −0 ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.exe.manifest
  187. BIN  ActiveDirectoryTools/obj/Release/ActiveDirectoryTools.inputAuthDialog.resources
  188. BIN  ActiveDirectoryTools/obj/Release/Interop.CDO.dll
  189. BIN  ActiveDirectoryTools/obj/Release/Interop.Microsoft.Office.Core.dll
  190. BIN  ActiveDirectoryTools/obj/Release/Interop.Microsoft.Office.Interop.Excel.dll
  191. BIN  ActiveDirectoryTools/obj/Release/Interop.VBIDE.dll
  192. BIN  ActiveDirectoryTools/obj/Release/Interop.WEBDIALERLib.dll
  193. BIN  ActiveDirectoryTools/obj/Release/ResolveAssemblyReference.cache
  194. BIN  ActiveDirectoryTools/obj/Release/TempPE/CompDATADataSet.Designer.cs.dll
  195. BIN  ActiveDirectoryTools/obj/Release/TempPE/Properties.Resources.Designer.cs.dll
  196. BIN  ActiveDirectoryTools/obj/Release/TempPE/Resources.Resource1.Designer.cs.dll
  197. +85 −0 CreateExcelWorksheet/CreateExcelWorksheet.csproj
  198. +48 −0 CreateExcelWorksheet/Program.cs
  199. +36 −0 CreateExcelWorksheet/Properties/AssemblyInfo.cs
  200. BIN  CreateExcelWorksheet/bin/Release/CreateExcelWorksheet.exe
  201. BIN  CreateExcelWorksheet/bin/Release/CreateExcelWorksheet.pdb
  202. BIN  CreateExcelWorksheet/bin/Release/Interop.Microsoft.Office.Core.dll
  203. BIN  CreateExcelWorksheet/bin/Release/Interop.Microsoft.Office.Interop.Excel.dll
  204. BIN  CreateExcelWorksheet/bin/Release/Interop.VBIDE.dll
  205. +12 −0 CreateExcelWorksheet/obj/Release/CreateExcelWorksheet.csproj.FileListAbsolute.txt
  206. BIN  CreateExcelWorksheet/obj/Release/CreateExcelWorksheet.csproj.ResolveComReference.cache
  207. BIN  CreateExcelWorksheet/obj/Release/CreateExcelWorksheet.exe
  208. BIN  CreateExcelWorksheet/obj/Release/CreateExcelWorksheet.pdb
  209. BIN  CreateExcelWorksheet/obj/Release/Interop.Microsoft.Office.Core.dll
  210. BIN  CreateExcelWorksheet/obj/Release/Interop.Microsoft.Office.Interop.Excel.dll
  211. BIN  CreateExcelWorksheet/obj/Release/Interop.VBIDE.dll
  212. BIN  CreateExcelWorksheet/obj/Release/ResolveAssemblyReference.cache
  213. +261 −0 RemoteProbe/ProbeForm.Designer.cs
  214. +76 −0 RemoteProbe/ProbeForm.cs
  215. +120 −0 RemoteProbe/ProbeForm.resx
  216. +21 −0 RemoteProbe/Program.cs
  217. +36 −0 RemoteProbe/Properties/AssemblyInfo.cs
  218. +71 −0 RemoteProbe/Properties/Resources.Designer.cs
  219. +117 −0 RemoteProbe/Properties/Resources.resx
  220. +30 −0 RemoteProbe/Properties/Settings.Designer.cs
  221. +7 −0 RemoteProbe/Properties/Settings.settings
  222. +92 −0 RemoteProbe/RemoteProbe.csproj
  223. +48 −0 RemoteProbe/Worker.cs
  224. BIN  RemoteProbe/bin/Release/RemoteProbe.exe
  225. BIN  RemoteProbe/bin/Release/RemoteProbe.pdb
  226. BIN  RemoteProbe/bin/Release/RemoteProbe.vshost.exe
  227. +11 −0 RemoteProbe/bin/Release/RemoteProbe.vshost.exe.manifest
  228. BIN  RemoteProbe/obj/Release/RemoteProbe.ProbeForm.resources
  229. BIN  RemoteProbe/obj/Release/RemoteProbe.Properties.Resources.resources
  230. +8 −0 RemoteProbe/obj/Release/RemoteProbe.csproj.FileListAbsolute.txt
  231. BIN  RemoteProbe/obj/Release/RemoteProbe.csproj.GenerateResource.Cache
  232. BIN  RemoteProbe/obj/Release/RemoteProbe.exe
  233. BIN  RemoteProbe/obj/Release/RemoteProbe.pdb
20 ActiveDirectoryTools.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActiveDirectoryTools", "ActiveDirectoryTools\ActiveDirectoryTools.csproj", "{D4947604-149D-40BD-B1CC-E74138529BB8}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D4947604-149D-40BD-B1CC-E74138529BB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D4947604-149D-40BD-B1CC-E74138529BB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D4947604-149D-40BD-B1CC-E74138529BB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D4947604-149D-40BD-B1CC-E74138529BB8}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
BIN  ActiveDirectoryTools.suo
Binary file not shown
376 ActiveDirectoryTools/ActiveDirectoryTools.csproj
@@ -0,0 +1,376 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{D4947604-149D-40BD-B1CC-E74138529BB8}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ActiveDirectoryTools</RootNamespace>
+ <AssemblyName>ActiveDirectoryTools</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <ApplicationIcon>Resources\network.ico</ApplicationIcon>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <ManifestCertificateThumbprint>BA82830559879DC4B4574087DA240E99DA056119</ManifestCertificateThumbprint>
+ <ManifestKeyFile>ActiveDirectoryTools_TemporaryKey.pfx</ManifestKeyFile>
+ <GenerateManifests>true</GenerateManifests>
+ <TargetZone>LocalIntranet</TargetZone>
+ <ApplicationManifest>Properties\app.manifest</ApplicationManifest>
+ <SignManifests>true</SignManifests>
+ <CreateDesktopShortcut>true</CreateDesktopShortcut>
+ <PublishWizardCompleted>true</PublishWizardCompleted>
+ <PublishUrl>C:\rmt\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
+ <ApplicationRevision>64</ApplicationRevision>
+ <ApplicationVersion>2.0.0.%2a</ApplicationVersion>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <BootstrapperComponentsUrl>\\ironhide\public\Install\dotNET</BootstrapperComponentsUrl>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="ServiceProvider, Version=4.2.2.60, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\references\dmcc-dotnet-sdk\Dashboard\ServiceProvider.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.DirectoryServices" />
+ <Reference Include="System.Management" />
+ <Reference Include="System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Deployment" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Classes\AvayaControl.cs" />
+ <Compile Include="Classes\DomainTools.cs" />
+ <Compile Include="Classes\ListViewColumnSorter.cs" />
+ <Compile Include="Classes\Settings.cs" />
+ <Compile Include="Classes\ExchangeMgmt.cs" />
+ <Compile Include="Classes\UserControls.cs" />
+ <Compile Include="Classes\RemoteConnect.cs" />
+ <Compile Include="CompDATADataSet.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>CompDATADataSet.xsd</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\AdminExplorer.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\AdminExplorer.Designer.cs">
+ <DependentUpon>AdminExplorer.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Classes\RegistryControl.cs" />
+ <Compile Include="Classes\DirectoryReport.cs" />
+ <Compile Include="Classes\Program.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Forms\AdvancedSearch.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\AdvancedSearch.Designer.cs">
+ <DependentUpon>AdvancedSearch.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\CopyUser.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\CopyUser.Designer.cs">
+ <DependentUpon>CopyUser.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\FindRep.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\FindRep.Designer.cs">
+ <DependentUpon>FindRep.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\GroupProperties.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\GroupProperties.Designer.cs">
+ <DependentUpon>GroupProperties.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\SelectExchDatabase.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\SelectExchDatabase.Designer.cs">
+ <DependentUpon>SelectExchDatabase.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\SelectGroup.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\SelectGroup.Designer.cs">
+ <DependentUpon>SelectGroup.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\GetTextInput.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\GetTextInput.Designer.cs">
+ <DependentUpon>GetTextInput.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\ObjectProperties.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\ObjectProperties.Designer.cs">
+ <DependentUpon>ObjectProperties.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\inputAuthDialog.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\inputAuthDialog.Designer.cs">
+ <DependentUpon>inputAuthDialog.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\MainWindow.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\MainWindow.Designer.cs">
+ <DependentUpon>MainWindow.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\RunCleanup.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\RunCleanup.Designer.cs">
+ <DependentUpon>RunCleanup.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\SelectUserForGroup.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\SelectUserForGroup.Designer.cs">
+ <DependentUpon>SelectUserForGroup.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\SetPassword.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\SetPassword.Designer.cs">
+ <DependentUpon>SetPassword.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Forms\TermUser.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Forms\TermUser.Designer.cs">
+ <DependentUpon>TermUser.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <EmbeddedResource Include="Forms\AdminExplorer.resx">
+ <DependentUpon>AdminExplorer.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\AdvancedSearch.resx">
+ <DependentUpon>AdvancedSearch.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\CopyUser.resx">
+ <DependentUpon>CopyUser.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\FindRep.resx">
+ <DependentUpon>FindRep.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\GetTextInput.resx">
+ <DependentUpon>GetTextInput.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\GroupProperties.resx">
+ <DependentUpon>GroupProperties.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\inputAuthDialog.resx">
+ <DependentUpon>inputAuthDialog.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\MainWindow.resx">
+ <DependentUpon>MainWindow.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\ObjectProperties.resx">
+ <DependentUpon>ObjectProperties.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\RunCleanup.resx">
+ <DependentUpon>RunCleanup.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\SelectExchDatabase.resx">
+ <DependentUpon>SelectExchDatabase.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\SelectGroup.resx">
+ <DependentUpon>SelectGroup.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\SelectUserForGroup.resx">
+ <DependentUpon>SelectUserForGroup.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\SetPassword.resx">
+ <DependentUpon>SetPassword.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Forms\TermUser.resx">
+ <DependentUpon>TermUser.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>PublicResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ <DesignTime>True</DesignTime>
+ </Compile>
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ </None>
+ <Compile Include="Properties\Settings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ <Compile Include="DefaultSettings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ <DependentUpon>DefaultSettings.settings</DependentUpon>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ActiveDirectoryTools_TemporaryKey.pfx" />
+ <None Include="Properties\app.manifest" />
+ <None Include="Resources\network.ico" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ <None Include="Resources\busy1.gif" />
+ <None Include="DefaultSettings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>DefaultSettings.Designer.cs</LastGenOutput>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="CompDATADataSet.xsc">
+ <DependentUpon>CompDATADataSet.xsd</DependentUpon>
+ </None>
+ <None Include="CompDATADataSet.xsd">
+ <Generator>MSDataSetGenerator</Generator>
+ <LastGenOutput>CompDATADataSet.Designer.cs</LastGenOutput>
+ <SubType>Designer</SubType>
+ </None>
+ <None Include="CompDATADataSet.xss">
+ <DependentUpon>CompDATADataSet.xsd</DependentUpon>
+ </None>
+ <None Include="Resources\process-stop.png" />
+ <None Include="Resources\emblem-readonly.png" />
+ <None Include="Resources\face-grin.png" />
+ <None Include="Resources\face-sad.png" />
+ <None Include="Resources\go-next.png" />
+ <None Include="Resources\edit-find.png" />
+ <None Include="Resources\edit-clear.png" />
+ <None Include="Resources\go-home.png" />
+ <None Include="Resources\17-1.gif" />
+ <None Include="Resources\17-11.gif" />
+ <None Include="Resources\list-add.png" />
+ <None Include="Resources\Full Logo 2008.PNG" />
+ <Content Include="Resources\progress.gif" />
+ <None Include="Resources\system-lock-screen.png" />
+ <None Include="Resources\user-home.png" />
+ <None Include="Resources\system-users.png" />
+ <None Include="Resources\window-new.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <COMReference Include="Microsoft.Office.Core">
+ <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
+ <VersionMajor>2</VersionMajor>
+ <VersionMinor>4</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ </COMReference>
+ <COMReference Include="Microsoft.Office.Interop.Excel">
+ <Guid>{00020813-0000-0000-C000-000000000046}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>6</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ </COMReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
16 ActiveDirectoryTools/ActiveDirectoryTools.csproj.user
@@ -0,0 +1,16 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <PublishUrlHistory>C:\rmt\|\\ironhide\public\Departments\MIS\Remote Management\INSTALL\|\\ironhide\public\Departments\MIS\Remote Management\|P:\Departments\MIS\Remote Management\|publish\</PublishUrlHistory>
+ <InstallUrlHistory>
+ </InstallUrlHistory>
+ <SupportUrlHistory>
+ </SupportUrlHistory>
+ <UpdateUrlHistory>
+ </UpdateUrlHistory>
+ <BootstrapperUrlHistory>\\ironhide\public\Install\dotNET</BootstrapperUrlHistory>
+ <ErrorReportUrlHistory>
+ </ErrorReportUrlHistory>
+ <FallbackCulture>en-US</FallbackCulture>
+ <VerifyUploadedFiles>false</VerifyUploadedFiles>
+ </PropertyGroup>
+</Project>
BIN  ActiveDirectoryTools/ActiveDirectoryTools_TemporaryKey.pfx
Binary file not shown
15 ActiveDirectoryTools/Classes/AvayaControl.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace ActiveDirectoryTools.Classes
+{
+ class AvayaControl
+ {
+ public static void makeCall()
+ {
+
+ }
+ }
+}
53 ActiveDirectoryTools/Classes/Cleanup.cs
@@ -0,0 +1,53 @@
+using System;
+using System.IO;
+using System.Security.Permissions;
+
+namespace ActiveDirectoryTools
+{
+ class Cleanup
+ {
+ public static void DeleteFiles()
+ {
+ string targetDir = "C:\\Documents and Settings\\";
+ string subDir = "\\Local Settings";
+
+ FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Write, targetDir);
+
+ DriveInfo.GetDrives();
+
+ string[] tmpDir = Directory.GetDirectories(targetDir);
+ string currentUser = Environment.UserName;
+ string combinedPath;
+
+ foreach (string fileName in (string)targetDir)
+ {
+ if (!fileName.Equals("Administrator") && !fileName.Equals("All Users") && !fileName.Equals("Default User"))
+ {
+ try
+ {
+ combinedPath = Path.Combine(fileName, subDir);
+
+ if (Directory.Exists(combinedPath))
+ {
+ Directory.Delete(combinedPath, true);
+ }
+ }
+
+ catch (Exception) { }
+
+ }
+ }
+ }
+
+ public static long GetFreeSpace()
+ {
+ //This method is not currently non-functional as security stops
+ //us from getting information about the hard disk.
+
+ long freeSpace = 0;
+
+ return freeSpace;
+
+ }
+ }
+}
454 ActiveDirectoryTools/Classes/DirectoryReport.cs
@@ -0,0 +1,454 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.DirectoryServices;
+using System.Diagnostics;
+using System.IO;
+using System.Windows.Forms;
+using System.Management;
+using System.Net;
+using System.Security;
+using ActiveDirectoryTools.Classes;
+using System.Data;
+
+namespace ActiveDirectoryTools
+{
+ class DirectoryReport
+ {
+ public static string ObjectType;
+ public static List<string> UserList = new List<string>();
+ public static Dictionary<string, string> ObjectList = new Dictionary<string, string>();
+ public static Dictionary<string, string> SearchList = new Dictionary<string, string>();
+ public static List<string> UserFolders = new List<string>();
+
+
+ public static bool DownloadFile(string fileloc, string saveto)
+ {
+ MessageBox.Show("downloading " + fileloc + " to " + saveto);
+ bool success = false;
+ try
+ {
+ WebClient getFile = new WebClient();
+ getFile.DownloadFile(fileloc, saveto);
+ success = true;
+ }
+ catch
+ {
+
+ }
+
+ return success;
+ }
+
+ public static void clearObjectList()
+ {
+ //ObjectList.Clear();
+ }
+
+ public static void setObjectType(string objectType)
+ {
+ ObjectType = objectType;
+ }
+
+ public static bool getDirectoryReport(string objectType, string search)
+ {
+ bool success = false;
+ if (!search.Equals("null"))
+ {
+ SearchList = searchList(objectType, search);
+ ObjectList = SearchList;
+ success = true;
+ }
+ else if (Directory.Exists(MainWindow.DEPSDIR) && objectType.Equals("Workstations"))
+ {
+ try
+ {
+ UserControls.fillUserFolder();
+
+ ObjectList = getDirectoryInfo("OU=" + objectType);
+ success = true;
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(e.ToString(), "Not Connected", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ ObjectList = new Dictionary<string, string>();
+ }
+ }
+ return success;
+ }
+
+ public static string convertDecToSize(decimal number)
+ {
+ string freeSpaceFinal = null;
+ if (number > 1024) //convert to KB
+ {
+ number = Math.Round(number / 1024, 2);
+ if (number > 1024) //convert to MB
+ {
+ number = Math.Round(number / 1024, 2);
+ if (number > 1024) //convert to GB
+ {
+ number = Math.Round(number / 1024, 2);
+ freeSpaceFinal = number + " GB";
+ }
+ else freeSpaceFinal = number + " MB";
+ }
+ else freeSpaceFinal = number + " KB";
+ }
+ else freeSpaceFinal = number + " B";
+
+ return freeSpaceFinal;
+ }
+
+ //this method is a mystery
+ public static decimal getFreeDiskSpace(string computer)
+ {
+ ConnectionOptions opt = new ConnectionOptions();
+ ObjectQuery oQuery = new ObjectQuery("SELECT Size, FreeSpace, Name, FileSystem FROM Win32_LogicalDisk WHERE DriveType = 3");
+
+ ManagementScope scope = new ManagementScope(@"\\" + computer + @"\root\cimv2", opt);
+ ManagementObjectSearcher moSearcher = new ManagementObjectSearcher(scope, oQuery);
+ ManagementObjectCollection collection = moSearcher.Get();
+
+ decimal freeSpace = 0;
+ foreach (ManagementObject res in collection)
+ {
+ freeSpace = Convert.ToDecimal(res["FreeSpace"]);
+ }
+ return freeSpace;
+ }
+
+ public static Dictionary<string, string[]> findRepPass(string searchString, bool searchByRegional)
+ {
+ Dictionary<string, string[]> results = new Dictionary<string, string[]>();
+ if (searchString.Length >= 3)
+ {
+ TextReader techReps = new StreamReader(MainWindow.DEPSDIR + "reps.txt");
+
+ string[] nameSplit = searchString.ToLower().Split(' ');
+ string[] splitReadLine;
+ string[] stringToSearch;
+ string fullReadLine;
+
+ while ((fullReadLine = techReps.ReadLine()) != null)
+ {
+
+ splitReadLine = fullReadLine.Split('\t');
+ if (searchByRegional)
+ {
+ stringToSearch = new string[] { splitReadLine[0], splitReadLine[1], splitReadLine[2] };
+ }
+ else
+ {
+ stringToSearch = new string[] { splitReadLine[3], splitReadLine[4] };
+ }
+ bool match = false;
+
+
+ for (int i = 0; i < stringToSearch.Length; i++)
+ {
+ foreach (string searchField in nameSplit)
+ {
+ if (stringToSearch[i].ToLower().Contains(searchField.ToLower()))
+ {
+ match = true;
+ }
+ else
+ {
+ match = false;
+ break;
+ }
+ }
+ if (match)
+ {
+ break;
+ }
+ }
+
+ if (match)
+ {
+ string[] userAndPass = new string[] { splitReadLine[4], splitReadLine[5] };
+ string keyToAdd = splitReadLine[3];
+ while (results.Keys.Contains(keyToAdd))
+ {
+ keyToAdd += "_";
+ }
+ results.Add(keyToAdd, userAndPass);
+ }
+ }
+ techReps.Close();
+ }
+ return results;
+ }
+
+ /*this method is called if no connection can be made to AD. It loads
+ * an object list from a txt file if it exists*/
+ public static List<string> importComputerList(string fileName)
+ {
+ List<string> importedFileItems = new List<string>();
+ TextReader importedFileStream = new StreamReader(fileName);
+ String line;
+ int i = 0;
+ while ((line = importedFileStream.ReadLine()) != null)
+ {
+ importedFileItems.Add(line);
+ i++;
+ }
+ importedFileStream.Close();
+ return importedFileItems;
+ }
+
+
+
+ //authenticate user against active directory
+ public static bool IsAuthenticated(string server, string user, string pass)
+ {
+ bool success = false;
+
+ try
+ {
+ DirectoryEntry entry = new DirectoryEntry(server, user, pass);
+ object nativeObject = entry.NativeObject;
+ success = true;
+ }
+
+ catch (Exception e)
+ {
+ if (e.ToString().ToLower().Contains("bad password"))
+ {
+ MessageBox.Show("You have entered an incorrect username/password combination", "Authentication failure", MessageBoxButtons.OK, MessageBoxIcon.Stop);
+ }
+ else
+ {
+ MessageBox.Show("An unknown error has occurred: \n\n" + e, "Unknown error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
+ }
+ }
+ return success;
+ }
+
+ public static void updateExtensions(string fName)
+ {
+ string line = string.Empty;
+ string user = string.Empty;
+ string ext = string.Empty;
+ try
+ {
+ TextReader clist = new StreamReader(fName);
+
+ while ((line = clist.ReadLine()) != null)
+ {
+ string[] lineSplit = line.Split('\t');
+ string foundUser = UserControls.findOneUserAD(lineSplit[1]);
+ if (!foundUser.Equals("NONE"))
+ {
+ DirectoryEntry ldapEntry = new DirectoryEntry("LDAP://" + foundUser);
+ ldapEntry.Properties["telephoneNumber"].Value = lineSplit[0].ToString();
+ ldapEntry.CommitChanges();
+ ldapEntry.Close();
+ //MessageBox.Show(ldapEntry.Name);
+ }
+ }
+
+ clist.Close();
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show("Error:\n\n" + e);
+ }
+ }
+
+
+ //method to export contents of listbox to text file
+ public static void exportToTxtFile(string fName, List<string> listObjects)
+ {
+ try
+ {
+ TextWriter clist = new StreamWriter(fName);
+
+ if (listObjects.Count <= 0)
+ {
+ MessageBox.Show("Object list is empty; aborting", "Error");
+ }
+
+ for (int i = 0; i < listObjects.Count; i++)
+ {
+ clist.WriteLine(listObjects[i]);
+ }
+
+ clist.Close();
+ Process.Start("notepad", fName);
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show("Error:" + e);
+ }
+ }
+
+ //this method returns a list that contains directory objects
+
+ public static Dictionary<string, string> getComputers(string ou)
+ {
+ Dictionary<string, string> objectNames = new Dictionary<string, string>();
+
+ try
+ {
+ DirectoryEntry ldapEntry = new DirectoryEntry(ou);
+ foreach (DirectoryEntry child in ldapEntry.Children)
+ {
+ if (child.Properties["objectcategory"][0].ToString().ToLower().Contains("computer"))
+ {
+ objectNames.Add(child.Name.Remove(0, 3), UserControls.getOuFromPath(child.Path));
+ }
+ }
+ }
+ catch { }
+
+ return objectNames;
+ }
+
+ public static Dictionary<string, string> getDirectoryInfo(string ou)
+ {
+ int totalComputers = 0;
+ Dictionary<string, string> objectNames = new Dictionary<string, string>();
+ //build list of computers
+ try
+ {
+ foreach (string path in Settings.ComputersArr)
+ {
+ DirectoryEntry ldapentry = new DirectoryEntry(path);
+ foreach (DirectoryEntry child in ldapentry.Children)
+ {
+ if (child.Properties["objectcategory"][0].ToString().ToLower().Contains("computer"))
+ {
+ objectNames.Add(child.Name.Remove(0, 3), UserControls.getOuFromPath(child.Path));
+ totalComputers++;
+ }
+ }
+ ldapentry.Close();
+ }
+ ObjectList = objectNames;
+ }
+ catch (EntryPointNotFoundException e)
+ {
+ MessageBox.Show("There was a problem querying directory:\n\n" + e, "Error in query", MessageBoxButtons.OK,
+ MessageBoxIcon.Warning);
+ }
+
+ return objectNames;
+ }
+
+ //perform a search on the item objectType
+ public static Dictionary<string, string> searchList(string filter, string objectType)
+ {
+ Dictionary<string, string> newList = new Dictionary<string, string>();
+
+ try
+ {
+ foreach (string path in Settings.ComputersArr)
+ {
+ DirectoryEntry ldapentry = new DirectoryEntry(path);
+ foreach (DirectoryEntry child in ldapentry.Children)
+ {
+ if (child.Name.ToLower().Contains(filter) && child.Properties["objectcategory"][0].ToString().ToLower().Contains("computer"))
+ {
+ newList.Add(child.Name.Remove(0, 3), child.Path);
+ }
+ }
+ ldapentry.Close();
+ }
+ SearchList = newList;
+ ObjectList = newList;
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show("Cannot connect to domain controller.\n\n" + e.ToString(), "Problem connecting", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ }
+ return newList;
+ }
+
+ public static bool remoteInstall(string computer, string program)
+ {
+ bool success = false;
+
+ if (program.Equals("MS Paint")) try
+ {
+ string fileToCopy = @"\\" + computer + @"\c$\windows\system32\mspaint.exe";
+ string linkToCopy = @"\\" + computer + @"\c$\documents and settings\all users\start menu\programs\accessories\Paint.lnk";
+
+ if (!File.Exists(fileToCopy) || !File.Exists(linkToCopy))
+ {
+ File.Copy(MainWindow.DEPSDIR + "mspaint.exe", fileToCopy, true);
+ File.Copy(MainWindow.DEPSDIR + "Paint.lnk", linkToCopy, true);
+ success = true;
+ }
+ else
+ {
+ MessageBox.Show("Program already installed.", "No action taken", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ }
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(e.ToString());
+ }
+ else if (program.Equals("MapPoint 2009"))
+ {
+ string installPath = @"\\vault\Software\ Mappoint 2009\Setup.exe";
+ SecureString securePass = new SecureString();
+
+ char[] tmpPass = MainWindow.PassData.ToCharArray();
+ for (int i = 0; i < tmpPass.Length; i++)
+ {
+ securePass.AppendChar(tmpPass[i]);
+ }
+
+ Process mapPoint = new Process();
+ mapPoint.StartInfo.UserName = MainWindow.UserData;
+ mapPoint.StartInfo.Password = securePass;
+ mapPoint.StartInfo.Domain = "APEX";
+ Process.Start("psexec", @"\\" + computer + " " + installPath);
+ }
+
+ return success;
+ }
+
+ public static bool powerShellInstalled()
+ {
+ bool installed = false;
+
+ if (Directory.Exists(Environment.SystemDirectory + @"\WindowsPowerShell"))
+ {
+ installed = true;
+ }
+ return installed;
+ }
+
+ public static string findUserFolder(string searchFor)
+ {
+ string rootPath = @"\\ratchet\users\";
+ string path = string.Empty;
+ foreach (string dir in Directory.GetDirectories(rootPath))
+ {
+ foreach (string subDir in Directory.GetDirectories(dir))
+ {
+ int pos = subDir.LastIndexOf("\\");
+ string folderName = subDir.Substring(pos).Remove(0,1);
+
+ if (folderName.ToLower().Equals(searchFor.ToLower()))
+ {
+ path = subDir;
+ break;
+ }
+ if (!path.Equals(string.Empty))
+ {
+ break;
+ }
+ }
+ }
+
+
+ return path;
+ }
+ }
+}
+
48 ActiveDirectoryTools/Classes/DiskCleanUp.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.DirectoryServices;
+using System.Security.Permissions;
+using System.IO;
+
+
+namespace ActiveDirectoryTools
+{
+ class DiskCleanUp
+ {
+
+ public static void DeleteFiles(string computer, string dir, string subDir)
+ {
+ string baseDir = computer + "\\c$\\" + dir;
+ FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Write, baseDir);
+
+ string[] tmpDir = Directory.GetDirectories(baseDir);
+ string currentUser = Environment.UserName;
+ string combinedPath;
+
+ foreach (string fileName in tmpDir)
+ {
+ if (!fileName.Equals("Administrator") && !fileName.Equals("All Users") && !fileName.Equals("Default User") && !fileName.Equals(currentUser))
+ {
+ Console.WriteLine("Skipped folder " + fileName);
+ }
+ else
+ {
+ try
+ {
+ combinedPath = Path.Combine(fileName, subDir);
+
+ if (Directory.Exists(combinedPath))
+ {
+ Directory.Delete(combinedPath, true);
+ }
+ }
+
+ catch (Exception) { }
+
+ }
+ }
+ }
+ }
+}
30 ActiveDirectoryTools/Classes/DomainTools.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.DirectoryServices;
+
+namespace ActiveDirectoryTools.Classes
+{
+ class DomainTools
+ {
+ public static bool isInDomain()
+ {
+ try
+ {
+ domain = System.DirectoryServices.ActiveDirectory.Domain.GetCompuetDomain();
+ }
+ finally
+ {
+ domain = null;
+ }
+ if (domain == null) domain = false;
+ else
+ {
+ domain = true;
+ }
+ return domain;
+ }
+
+ }
+}
58 ActiveDirectoryTools/Classes/ExcelWorkSheet.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Reflection;
+using Microsoft.Office.Interop.Excel;
+using System.Runtime.InteropServices;
+using System.Windows.Forms;
+
+namespace ActiveDirectoryTools.Classes
+{
+ class CreateExcelWorksheet
+ {
+ Workbook wb;
+ Worksheet ws;
+ Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application();
+ public static string[] alphabet = new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
+ "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
+
+ public CreateExcelWorksheet()
+ {
+ if (xlApp == null)
+ {
+ MessageBox.Show("EXCEL could not be started. Check that your office installation and project references are correct.");
+ return;
+ }
+ wb = xlApp.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);
+ ws = (Worksheet)wb.Worksheets[1];
+ }
+
+ public bool WriteRow(int row, Object[] rowData)
+ {
+ bool success = false;
+
+ try
+ {
+ Range aRange = ws.get_Range("A" + row, alphabet[rowData.Length-1] + "" + row);
+ Object[] args = new Object[1];
+ args[0] = rowData;
+ aRange.GetType().InvokeMember("Value", BindingFlags.SetProperty, null, aRange, args);
+ success = true;
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(e.ToString());
+ }
+
+ return success;
+ }
+
+ public void AutoFit()
+ {
+ xlApp.Columns.AutoFit();
+ }
+
+ public void Commit()
+ {
+ xlApp.Visible = true;
+ }
+ }
+}
129 ActiveDirectoryTools/Classes/ExchangeMgmt.cs
@@ -0,0 +1,129 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Management.Automation;
+using System.Management.Automation.Runspaces;
+using System.Windows.Forms;
+using System.DirectoryServices;
+
+namespace ActiveDirectoryTools
+{
+ class ExchangeMgmt
+ {
+ public static string errorMessage = string.Empty;
+ public static Dictionary<string, string> Databases = new Dictionary<string, string>();
+
+ public static Dictionary<string, string> getExchangeDatabases()
+ {
+ Dictionary<string, string> mailBoxPaths = new Dictionary<string, string>();
+ string mailBoxesPath = "CN=InformationStore,CN=Mailbox,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT)," +
+ "CN=Administrative Groups,CN=APEX,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=APEX,DC=Local";
+
+ DirectoryEntry ldapEntry = new DirectoryEntry("LDAP://" + mailBoxesPath);
+ foreach (DirectoryEntry entry in ldapEntry.Children)
+ {
+ foreach (DirectoryEntry rootEntry in entry.Children)
+ {
+ mailBoxPaths.Add(rootEntry.Name, @"Mailbox\" + rootEntry.Name.Remove(0, 3) + @"\" + rootEntry.Name.Remove(0, 3));
+ }
+ }
+ return mailBoxPaths;
+ }
+
+ public static bool hideMailbox(string userPath, bool hide)
+ {
+ bool success = false;
+ try
+ {
+ RunspaceConfiguration config = RunspaceConfiguration.Create();
+ PSSnapInException warning;
+
+ config.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin", out warning);
+ if (warning != null) throw warning;
+
+ Runspace exRunSpace = RunspaceFactory.CreateRunspace(config);
+ exRunSpace.Open();
+
+ Pipeline exPipeline = exRunSpace.CreatePipeline();
+ exPipeline.Commands.Add("Set-Mailbox");
+ exPipeline.Commands[0].Parameters.Add("Identity", userPath);
+ exPipeline.Commands[0].Parameters.Add("hiddenfromaddresslistsenabled", hide);
+
+ exPipeline.Invoke();
+ exPipeline.Dispose();
+ exRunSpace.Close();
+ success = true;
+ }
+
+ catch { }
+
+ return success;
+ }
+
+ public static bool enableMailbox(string database, string identity)
+ {
+ bool success = false;
+ try
+ {
+ RunspaceConfiguration config = RunspaceConfiguration.Create();
+ PSSnapInException warning;
+
+ //using exchange powershell snap-in to create mailbox
+ config.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin", out warning);
+ if (warning != null) throw warning;
+
+ Runspace exRunSpace = RunspaceFactory.CreateRunspace(config);
+ exRunSpace.Open();
+ Pipeline exPipeline = exRunSpace.CreatePipeline();
+
+ exPipeline.Commands.Add("Enable-Mailbox");
+ exPipeline.Commands[0].Parameters.Add("Database", database);
+ exPipeline.Commands[0].Parameters.Add("identity", identity);
+
+ exPipeline.Invoke();
+ exPipeline.Dispose();
+ exRunSpace.Close();
+ success = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.Message.ToString();
+ }
+
+ return success;
+ }
+
+ public static bool disableMailbox(string identity)
+ {
+ bool success = false;
+ try
+ {
+ RunspaceConfiguration config = RunspaceConfiguration.Create();
+ PSSnapInException warning;
+
+ //using exchange powershell snap-in to create mailbox
+ config.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin", out warning);
+ if (warning != null) throw warning;
+
+ Runspace exRunSpace = RunspaceFactory.CreateRunspace(config);
+ exRunSpace.Open();
+ Pipeline exPipeline = exRunSpace.CreatePipeline();
+
+ exPipeline.Commands.Add("Disable-Mailbox");
+ exPipeline.Commands[0].Parameters.Add("identity", identity);
+
+ exPipeline.Invoke();
+ exPipeline.Dispose();
+ exRunSpace.Close();
+ success = true;
+ }
+ catch (Exception e)
+ {
+ errorMessage = e.ToString();
+ }
+
+ return success;
+ }
+ }
+}
135 ActiveDirectoryTools/Classes/ListViewColumnSorter.cs
@@ -0,0 +1,135 @@
+using System;
+using System.Linq;
+using System.Management;
+using System.DirectoryServices;
+using System.Collections;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using System.Net;
+using System.Net.NetworkInformation;
+using System.Text;
+
+/// <summary>
+/// This class is an implementation of the 'IComparer' interface.
+/// </summary>
+///
+
+public class ListViewColumnSorter : IComparer
+{
+ /// <summary>
+ /// Specifies the column to be sorted
+ /// </summary>
+ private int ColumnToSort;
+ /// <summary>
+ /// Specifies the order in which to sort (i.e. 'Ascending').
+ /// </summary>
+ private SortOrder OrderOfSort;
+ /// <summary>
+ /// Case insensitive comparer object
+ /// </summary>
+ private CaseInsensitiveComparer ObjectCompare;
+
+ /// <summary>
+ /// Class constructor. Initializes various elements
+ /// </summary>
+ public ListViewColumnSorter()
+ {
+ // Initialize the column to '0'
+ ColumnToSort = 0;
+
+ // Initialize the sort order to 'none'
+ OrderOfSort = SortOrder.None;
+
+ // Initialize the CaseInsensitiveComparer object
+ ObjectCompare = new CaseInsensitiveComparer();
+ }
+
+ /// <summary>
+ /// This method is inherited from the IComparer interface. It compares the two objects passed using a case insensitive comparison.
+ /// </summary>
+ /// <param name="x">First object to be compared</param>
+ /// <param name="y">Second object to be compared</param>
+ /// <returns>The result of the comparison. "0" if equal, negative if 'x' is less than 'y' and positive if 'x' is greater than 'y'</returns>
+
+ public int Compare(object x, object y)
+ {
+ int compareResult = 0;
+ ListViewItem listviewX, listviewY;
+
+ // Cast the objects to be compared to ListViewItem objects
+ listviewX = (ListViewItem)x;
+ listviewY = (ListViewItem)y;
+
+ // Compare the two items
+ if ((ColumnToSort == 5 || ColumnToSort == 2) && ((listviewY.SubItems[ColumnToSort].Text.Contains(" MB") && listviewX.SubItems[ColumnToSort].Text.Contains(" MB")) || (listviewY.SubItems[ColumnToSort].Text.Contains(" GB") && listviewX.SubItems[ColumnToSort].Text.Contains(" GB"))))
+ {
+ decimal xSize = Convert.ToDecimal(listviewX.SubItems[ColumnToSort].Text.Substring(0, listviewX.SubItems[ColumnToSort].Text.IndexOf(' ')));
+ decimal ySize = Convert.ToDecimal(listviewY.SubItems[ColumnToSort].Text.Substring(0, listviewY.SubItems[ColumnToSort].Text.IndexOf(' ')));
+ if (xSize < ySize)
+ {
+ compareResult = 1;
+ }
+ else if (xSize == ySize)
+ {
+ compareResult = 0;
+ }
+ else if (xSize > ySize)
+ {
+ compareResult = -1;
+ }
+ }
+ else
+ {
+ compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text);
+ }
+
+
+ // Calculate correct return value based on object comparison
+ if (OrderOfSort == SortOrder.Ascending)
+ {
+ // Ascending sort is selected, return normal result of compare operation
+ return compareResult;
+ }
+ else if (OrderOfSort == SortOrder.Descending)
+ {
+ // Descending sort is selected, return negative result of compare operation
+ return (-compareResult);
+ }
+ else
+ {
+ // Return '0' to indicate they are equal
+ return 0;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the number of the column to which to apply the sorting operation (Defaults to '0').
+ /// </summary>
+ public int SortColumn
+ {
+ set
+ {
+ ColumnToSort = value;
+ }
+ get
+ {
+ return ColumnToSort;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the order of sorting to apply (for example, 'Ascending' or 'Descending').
+ /// </summary>
+ public SortOrder Order
+ {
+ set
+ {
+ OrderOfSort = value;
+ }
+ get
+ {
+ return OrderOfSort;
+ }
+ }
+
+}
53 ActiveDirectoryTools/Classes/Program.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
+using System.IO;
+
+namespace ActiveDirectoryTools
+{
+ static class Program
+ {
+ public static String mode = String.Empty;
+ [STAThread]
+ static void Main()
+ {
+ //how should application run? Modes = domain or workstation
+ if (Classes.DomainTools.isInDomain())
+ {
+ mode = "domain";
+ string userDn = Classes.UserControls.findOneUserAD(Environment.UserName);
+
+ List<string> userGroups = Classes.UserControls.getAllGroups(userDn);
+ bool isAdmin = false;
+ foreach (string group in userGroups)
+ {
+ if (group.Contains("Account Operators") || group.Contains("Domain Admins"))
+ {
+ isAdmin = true;
+ break;
+ }
+ }
+
+ if (!isAdmin)
+ {
+ MessageBox.Show("You must be a domain admin to run this application.", "Insufficient rights", MessageBoxButtons.OK, MessageBoxIcon.Stop);
+ Application.Exit();
+ }
+ else
+ {
+ Classes.Settings.initializeSettings();
+
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MainWindow());
+ }
+ }
+ else
+ {
+ mode = "workstation";
+ }
+
+ }
+ }
+}
76 ActiveDirectoryTools/Classes/RegistryControl.cs
@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Security.Permissions;
+using Microsoft.Win32;
+using System.Windows.Forms;
+
+[assembly: RegistryPermissionAttribute(SecurityAction.RequestMinimum, ViewAndModify = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server")]
+[assembly: SecurityPermissionAttribute(SecurityAction.RequestMinimum, Unrestricted = true)]
+
+namespace ActiveDirectoryTools
+{
+ class RegistryControl
+ {
+ public static bool checkRdEnabled(string computer)
+ {
+ bool success = false;
+ RegistryKey environmentKey;
+ try
+ {
+ environmentKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,
+ computer).OpenSubKey(@"System\CurrentControlSet\Control\Terminal Server", RegistryKeyPermissionCheck.ReadWriteSubTree);
+ foreach (string value in environmentKey.GetValueNames())
+ {
+ if (value.Equals("fDenyTSConnections") && environmentKey.GetValue(value).ToString().Equals("0"))
+ {
+ success = true;
+ }
+ }
+ }
+ catch
+ {
+ success = false;
+ }
+
+ return success;
+ }
+
+
+ public static bool changeRemoteDesktop(string computer, string setto)
+ {
+ //if setto = 1 remote desktop will be disabled. 0 will enable
+ //the return of this function will help the calling member to determine if the operation was a success
+ bool success = false;
+ RegistryKey environmentKey;
+ try
+ {
+ environmentKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,
+ computer).OpenSubKey(@"System\CurrentControlSet\Control\Terminal Server", RegistryKeyPermissionCheck.ReadWriteSubTree);
+ foreach (string value in environmentKey.GetValueNames())
+ {
+ if (value.Equals("fDenyTSConnections"))
+ {
+ environmentKey.SetValue(value, setto, RegistryValueKind.DWord);
+ //check to verify the change was made
+ if (environmentKey.GetValue(value).ToString().Equals(setto))
+ {
+ success = true;
+ }
+ }
+ }
+
+ environmentKey.Close();
+ }
+ catch
+ {
+ success = false;
+ }
+
+ return success;
+
+ }
+
+ }
+}
462 ActiveDirectoryTools/Classes/RemoteConnect.cs
@@ -0,0 +1,462 @@
+using System;
+using System.Linq;
+using System.Management;
+using System.DirectoryServices;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using System.Net;
+using System.Net.NetworkInformation;
+using System.Text;
+using System.Data;
+using System.Data.OleDb;
+
+namespace ActiveDirectoryTools
+{
+ static class RemoteConnect
+ {
+ public static Dictionary<string, string> Computers = new Dictionary<string, string>();
+ public static string[] SearchArray = new string[] { "Model", "UserName", "Status", "TotalPhysicalMemory", "Name" };
+ public static List<ListViewItem> ResultList = new List<ListViewItem>();
+ public static int Count = 0;
+ public static ListViewItem CurrentRow = new ListViewItem();
+ public static Dictionary<string, int> Summary = new Dictionary<string, int>();
+ public static bool pauseRequest = false;
+ public static bool cancelRequest = false;
+ public static DataTable ComputerTable;
+
+ public static void importDatabase()
+ {
+ string connString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\ironhide\public\Departments\MIS\Remote Management\Dependencies\CompDATA.accdb";
+ string query = "SELECT * FROM MyTable";
+ CompDATADataSet myDataSet = new CompDATADataSet();
+ OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, new OleDbConnection(connString));
+
+ MessageBox.Show(myDataSet.Tables["main"].Rows[0].ToString());
+ dAdapter.Update(ComputerTable);
+ }
+
+ public static bool syncDatabase()
+ {
+ bool success = false;
+
+ try
+ {
+ CompDATADataSet myDataSet = new CompDATADataSet();
+ CompDATADataSetTableAdapters.mainTableAdapter mainTableAdapter = new ActiveDirectoryTools.CompDATADataSetTableAdapters.mainTableAdapter();
+
+ mainTableAdapter.Update(myDataSet);
+ success = true;
+ }
+ catch (Exception)
+ {
+ //MessageBox.Show(e.ToString());
+ }
+
+ return success;
+ }
+
+ public static void createDataTable()
+ {
+ ComputerTable = MakeNamesTable();
+ /*OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;Data Source=\\ironhide\public\Departments\MIS\Remote Management\Dependencies\CompDATA.mdb");
+
+ conn.Open();
+ OleDbDataAdapter adapter = new OleDbDataAdapter();
+ OleDbCommand command = new OleDbCommand("SELECT * from main", conn);
+ adapter.SelectCommand = command;
+ OleDbCommandBuilder cb = new OleDbCommandBuilder(adapter);*/
+ }
+
+ public static DataTable MakeNamesTable()
+ {
+ // Create a new DataTable titled 'Names.'
+ DataTable namesTable = new DataTable("main");
+ // Add three column objects to the table.
+
+ DataColumn idColumn = new DataColumn();
+ idColumn.DataType = System.Type.GetType("System.Int32");
+ idColumn.ColumnName = "id";
+ idColumn.AutoIncrement = true;
+ namesTable.Columns.Add(idColumn);
+
+ DataColumn compNameCol = new DataColumn();
+ compNameCol.DataType = System.Type.GetType("System.String");
+ compNameCol.ColumnName = "compname";
+ compNameCol.DefaultValue = string.Empty;
+ namesTable.Columns.Add(compNameCol);
+
+ DataColumn modelCol = new DataColumn();
+ modelCol.DataType = System.Type.GetType("System.String");
+ modelCol.ColumnName = "model";
+ modelCol.DefaultValue = string.Empty;
+ namesTable.Columns.Add(modelCol);
+
+ DataColumn memoryCol = new DataColumn();
+ memoryCol.DataType = System.Type.GetType("System.String");
+ memoryCol.ColumnName = "memory";
+ memoryCol.DefaultValue = string.Empty;
+ namesTable.Columns.Add(memoryCol);
+
+ DataColumn usernameCol = new DataColumn();
+ usernameCol.DataType = System.Type.GetType("System.String");
+ usernameCol.ColumnName = "username";
+ usernameCol.DefaultValue = string.Empty;
+ namesTable.Columns.Add(usernameCol);
+
+ DataColumn statusCol = new DataColumn();
+ statusCol.DataType = System.Type.GetType("System.String");
+ statusCol.ColumnName = "status";
+ statusCol.DefaultValue = string.Empty;
+ namesTable.Columns.Add(statusCol);
+
+ DataColumn freespaceCol = new DataColumn();
+ freespaceCol.DataType = System.Type.GetType("System.String");
+ freespaceCol.ColumnName = "freespace";
+ freespaceCol.DefaultValue = string.Empty;
+ namesTable.Columns.Add(freespaceCol);
+
+ DataColumn servicetagCol = new DataColumn();
+ servicetagCol.DataType = System.Type.GetType("System.String");
+ servicetagCol.ColumnName = "servicetag";
+ servicetagCol.DefaultValue = string.Empty;
+ namesTable.Columns.Add(servicetagCol);
+
+ DataColumn[] keys = new DataColumn[1];
+ keys[0] = compNameCol;
+ namesTable.PrimaryKey = keys;
+
+ return namesTable;
+ }
+
+
+ public static bool updateRow(string computer)
+ {
+ object[] data = new object[] { false, -1 };
+ bool contained = false;
+ foreach (DataRow row in ComputerTable.Rows)
+ {
+ if (row.ItemArray[0].ToString().ToLower().Contains(computer.ToLower()))
+ {
+ ComputerTable.Rows.Remove(row);
+ contained = true;
+ break;
+ }
+ }
+ return contained;
+ }
+
+ public static bool updateDatabase(ListViewItem row)
+ {
+
+ bool success = false;
+
+ foreach (DataRow rowSearch in ComputerTable.Rows)
+ {
+ if (rowSearch.ItemArray[0].ToString().ToLower().Contains(row.Text.ToLower()))
+ {
+ ComputerTable.Rows.Remove(rowSearch);
+ break;
+ }
+ }
+
+ object[] rowToAdd = new object[] { row.SubItems[0].Text, row.SubItems[1].Text, row.SubItems[2].Text, row.SubItems[3].Text, row.SubItems[4].Text, row.SubItems[5].Text, row.SubItems[6].Text };
+
+ DataRow myRow = ComputerTable.NewRow();
+
+ int index = 0;
+ if (ComputerTable.Rows.Count > 0)
+ {
+ index = ComputerTable.Rows.Count - 1;
+ }
+
+ // Then add the new row to the collection.
+ myRow["compname"] = row.SubItems[0].Text;
+ myRow["model"] = row.SubItems[1].Text;
+ myRow["memory"] = row.SubItems[2].Text;
+ myRow["username"] = row.SubItems[3].Text;
+ myRow["status"] = row.SubItems[4].Text;
+ myRow["freespace"] = row.SubItems[5].Text;
+ myRow["servicetag"] = row.SubItems[6].Text;
+ ComputerTable.Rows.InsertAt(myRow, index);
+
+ //dataGrid1.DataSource = myTable;
+
+ return success;
+ }
+
+ public static bool isInArray(string searchString, string[] arrayToSearch)
+ {
+ bool match = false;
+
+ int strNumber;
+ int strIndex = 0;
+ for (strNumber = 0; strNumber < arrayToSearch.Length; strNumber++)
+ {
+ strIndex = arrayToSearch[strNumber].IndexOf(searchString);
+ if (strIndex >= 0)
+ {
+ match = true;
+ }
+ }
+ return match;
+ }
+
+ /*public static bool renameComputer(string computer, string newName)
+ {
+ bool success = false;
+
+ string MyString = string.Empty;
+ string RemoteMachineName = computer;
+ string MyScope = @"\\" + RemoteMachineName + @"\root\cimv2";
+ string MyQuery = "select * from Win32_ComputerSystem";
+ if (canConnect(computer))
+ {
+ try
+ {
+ ConnectionOptions co = new ConnectionOptions();
+ co.Authentication = AuthenticationLevel.PacketPrivacy;
+
+ ManagementPath mp = new ManagementPath("Win32_ComputerSystem");
+ ManagementScope ms = new ManagementScope(MyScope, co);
+ ObjectGetOptions ogo = new ObjectGetOptions();
+ ManagementObject dir = new ManagementObject(ms, mp, ogo);
+ dir.Get();
+ //ms.Connect();
+ //ManagementObject dir = new ManagementObject(mp
+
+ ManagementBaseObject inputArgs = dir.GetMethodParameters("Rename");
+
+ inputArgs["Name"] = newName;
+ inputArgs["UserName"] = @"apex\dryder";
+ inputArgs["Password"] = "";
+
+ ManagementBaseObject outParams = dir.InvokeMethod("Rename", inputArgs, null);
+ uint ret = (uint)(outParams.Properties["ReturnValue"].Value);
+ if (ret == 0)
+ {
+ MessageBox.Show("Success");
+ }
+ else
+ {
+ MessageBox.Show("Fail");
+ }
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(e.ToString());
+ }
+ }
+
+ return success;
+ }*/
+
+ public static bool canConnect(string host)
+ {
+ bool connect = false;
+ try
+ {
+ Ping pingSender = new Ping();
+ PingOptions options = new PingOptions();
+ options.DontFragment = true;
+ string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
+ byte[] buffer = Encoding.ASCII.GetBytes(data);
+ int timeout = 120;
+ PingReply reply = pingSender.Send(host + ".APEX.Local", timeout, buffer, options);
+ if (reply.Status == IPStatus.Success)
+ {
+ connect = true;
+ }
+ }
+ catch { }
+
+ return connect;
+
+ }
+
+ public static string convertDecToSize(decimal number)
+ {
+ string freeSpaceFinal = null;
+ if (number > 1024) //convert to KB
+ {
+ number = Math.Round(number / 1024, 0);
+ if (number > 1024) //convert to MB
+ {
+ number = Math.Round(number / 1024, 0);
+ if (number > 1024) //convert to GB
+ {
+ number = Math.Round(number / 1024, 0);
+ freeSpaceFinal = number + " GB";
+ }
+ else freeSpaceFinal = number + " MB";
+ }
+ else freeSpaceFinal = number + " KB";
+ }
+ else freeSpaceFinal = number + " B";
+
+ return freeSpaceFinal;
+ }
+
+ public static ListViewItem getComputerListViewItem(string computer)
+ {
+ ListViewItem itemOut = new ListViewItem();
+
+ string MyString = string.Empty;
+ string RemoteMachineName = computer;
+ string MyScope = @"\\" + RemoteMachineName + @"\root\cimv2";
+ string MyQuery = "select * from Win32_ComputerSystem";
+ if (RemoteConnect.canConnect(computer))
+ {
+ try
+ {
+ ManagementObjectSearcher MyMOS = new ManagementObjectSearcher(MyScope, MyQuery);
+
+ foreach (ManagementObject MyMO in MyMOS.Get())
+ {
+ foreach (PropertyData MyProperty in MyMO.Properties)
+ {
+ if (MyProperty.Value != null && isInArray(MyProperty.Name, SearchArray))
+ {
+ if (MyProperty.Name.ToString().Contains("Model"))
+ {
+ if (MyProperty.Value.ToString().Contains("520"))
+ {
+ Summary["520"]++;
+ }
+ else if (MyProperty.Value.ToString().Contains("740"))
+ {
+ Summary["740"]++;
+ }
+ else if (MyProperty.Value.ToString().Contains("755"))
+ {
+ Summary["755"]++;
+ }
+ else if (MyProperty.Value.ToString().Contains("760"))
+ {
+ Summary["760"]++;
+ }
+ else if (MyProperty.Value.ToString().Contains("960"))
+ {
+ Summary["960"]++;
+ }
+ else
+ {
+ Summary["other"]++;
+ }
+ }
+ if (MyProperty.Name.ToString().Contains("TotalPhysicalMemory"))
+ {
+ long memorySize = Convert.ToInt64(MyProperty.Value) / 1024 / 1024;
+ string sizeString = string.Empty;
+ if (memorySize > 400 && memorySize < 800)
+ {
+ sizeString = "512 MB";
+ }
+ else if (memorySize > 800 && memorySize < 1400)
+ {
+ sizeString = "1024 MB";
+ }
+ else if (memorySize > 1400 && memorySize < 2400)
+ {
+ sizeString = "2048 MB";
+ }
+ else if (memorySize > 2400 && memorySize < 3400)
+ {
+ sizeString = "3072 MB";
+ }
+ else
+ {
+ sizeString = memorySize + " MB";
+ }
+ //RemoteConnect.convertDecToSize(Convert.ToDecimal(MyProperty.Value));
+ MyString += sizeString + ";";
+ }
+ else
+ {
+ MyString += MyProperty.Value.ToString().Trim() + ";";
+ }
+ }
+ else if (MyProperty.Value == null && isInArray(MyProperty.Name, SearchArray))
+ {
+ if (MyProperty.Name.Contains("UserName"))
+ {
+ MyString += "LOGGED OFF;";
+ }
+ else
+ {
+ MyString += string.Empty + ";";
+ }
+ }
+ }
+ MyString += Math.Round(getFreeDiskSpace(computer) / 1024 / 1024 / 1024, 1) + " GB;";
+ MyString += getServiceTag(computer) + ";";
+ }
+ string[] formattedString = MyString.Split(';');
+ string[] finalString = new string[] { formattedString[1], formattedString[0], formattedString[3], formattedString[4], formattedString[2], formattedString[5], formattedString[6] };
+ itemOut = new ListViewItem(finalString);
+ Count++;
+ }
+
+ //can connect, but encountered another error:
+ catch (Exception)
+ {
+ string[] errorRow = new string[] { computer, string.Empty, string.Empty, string.Empty, "PROBE FAILED", string.Empty, string.Empty };
+ itemOut = new ListViewItem(errorRow);
+ Count++;
+ Summary["errors"]++;
+ }
+ }
+ else
+ {
+ string[] errorRow = new string[] { computer, string.Empty, string.Empty, string.Empty, "CONNECT FAILED", string.Empty, string.Empty };
+ itemOut = new ListViewItem(errorRow);
+ Count++;
+ Summary["errors"]++;
+ }
+ //updateDatabase(itemOut);
+ return itemOut;
+ }
+
+ public static string getServiceTag(string computer)
+ {
+ string serviceTag = string.Empty;
+
+ try
+ {
+ if (canConnect(computer))
+ {
+ ManagementScope scope = new ManagementScope(@"\\" + computer + @"\root\cimv2");
+ ManagementPath path = new ManagementPath("Win32_Bios");
+ ObjectGetOptions obj = new ObjectGetOptions(null);
+ ManagementClass wmi = new ManagementClass(scope, path, obj);
+ foreach (ManagementObject bios in wmi.GetInstances())
+ {
+ serviceTag = bios.Properties["Serialnumber"].Value.ToString().Trim();
+ //myString += " rev:" + bios.Properties["smbiosbiosversion"].Value.ToString().Trim();
+ }
+ }
+ }
+ catch { }
+
+ return serviceTag;
+ }
+
+ public static decimal getFreeDiskSpace(string computer)
+ {
+ ConnectionOptions opt = new ConnectionOptions();
+ ObjectQuery oQuery = new ObjectQuery("SELECT Size, FreeSpace, Name, FileSystem FROM Win32_LogicalDisk WHERE DriveType = 3");
+
+ ManagementScope scope = new ManagementScope(@"\\" + computer + @"\root\cimv2", opt);
+ ManagementObjectSearcher moSearcher = new ManagementObjectSearcher(scope, oQuery);
+ ManagementObjectCollection collection = moSearcher.Get();
+
+ decimal freeSpace = 0;
+ foreach (ManagementObject res in collection)
+ {
+ freeSpace = Convert.ToDecimal(res["FreeSpace"]);
+ }
+ return freeSpace;
+ }
+
+
+ }
+}
43 ActiveDirectoryTools/Classes/Settings.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace ActiveDirectoryTools.Classes
+{
+ class Settings
+ {
+ public static string DC = string.Empty;
+ public static string primaryOu = string.Empty;
+ public static string dcDn = string.Empty;
+ public static string LDAPSTRING = string.Empty;
+ public static string DOMAIN = string.Empty;
+ public static string DISABLEDOU = string.Empty;
+ public static string ComputersDN = string.Empty;
+ public static string[] ComputersArr = null;
+ public static string[] ComputerSearchArr = null;
+
+ public static bool initializeSettings()
+ {
+ /*MessageBox.Show("" + Properties.Settings.Default.Properties["domain"].ToString());
+ DC = Properties.Settings.Default.Properties["domain"].ToString();
+ primaryOu = Properties.Settings.Default.Properties["primaryOu"].ToString();
+
+ foreach (string dc in DC.Split('.'))
+ {
+ dcDn += "DC=" + dc + ",";
+ }*/
+ primaryOu = "Apex";
+ dcDn = "DC=APEX,DC=Local";
+ LDAPSTRING = "LDAP://OU=" + primaryOu + "," + dcDn;
+ DOMAIN = "APEX.Local";
+ DISABLEDOU = "OU=*Disabled,OU=Apex,DC=APEX,DC=Local";
+ ComputersDN = "OU=Workstations,OU=Apex,DC=APEX,DC=Local";
+ ComputersArr = new string[] { "LDAP://OU=Workstations,OU=Apex,DC=APEX,DC=Local", "LDAP://OU=Call Center,OU=Workstations,OU=Apex,DC=APEX,DC=Local" };
+
+ return true;
+
+ }
+ }
+}
1,083 ActiveDirectoryTools/Classes/UserControls.cs
@@ -0,0 +1,1083 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.DirectoryServices;
+using System.Windows.Forms;
+using System.Threading;
+using System.IO;
+using System.Data;
+using System.Diagnostics;
+
+namespace ActiveDirectoryTools.Classes
+{
+//This class will process all controls from the Users tab.
+
+ class UserControls
+ {
+ const int UF_ACCOUNTDISABLE = 0x0002;
+ const int UF_PASSWD_NOTREQD = 0x0020;
+ const int UF_PASSWD_CANT_CHANGE = 0x0040;
+ const int UF_NORMAL_ACCOUNT = 0x0200;
+ const int UF_DONT_EXPIRE_PASSWD = 0x10000;
+ const int UF_SMARTCARD_REQUIRED = 0x40000;
+ const int UF_PASSWORD_EXPIRED = 0x800000;
+
+ //public const string LDAPSTRING = "LDAP://OU=Apex,DC=APEX,DC=Local";
+ public static List<string> UserFolders = new List<string>();
+ public static string SelectedUser = string.Empty;
+ public static string SelectedUserForGroup = string.Empty;
+ public static List<string> UserList = new List<string>();
+ public static List<string> GroupList = new List<string>();
+ public static string ClipboardText = string.Empty;
+ public static string TermDescription = string.Empty;
+ public static List<string> GroupAddResults = new List<string>();
+ public static string NewPass = string.Empty;
+ public static Dictionary<string, string> UserProperties = new Dictionary<string, string>();
+ public static Dictionary<string, string> CurrentUsers = new Dictionary<string, string>();
+ public static Dictionary<string, string[]> CurrentDesc = new Dictionary<string, string[]>();
+ public static Dictionary<string, string> BatchUsers = new Dictionary<string, string>();
+ public static Dictionary<string, string> CopyUserDetails = new Dictionary<string, string>();
+ /*
+ * This method returns all children in the orginazational unit specified. ou="MIS"
+ * will return all users in the MIS folder. It also fills a dictionary list with the
+ * user and LDAP path of user so we don't have to search for the user later.
+ */
+ public static bool resetLockout(string displayName)
+ {
+ bool success = true;
+ try
+ {
+ DirectoryEntry ldapEntry = new DirectoryEntry(CurrentUsers[displayName]);
+ ldapEntry.Properties["LockOutTime"].Value = 0;
+ ldapEntry.CommitChanges();
+ success = true;
+ }
+ catch { }
+ return success;
+ }
+
+ public static string getOuFromPath(string ou)
+ {
+ string ouPath = ou.Remove(0, 7);
+ string[] ouPathReversed = ouPath.Split(',');
+ string[] ouPathArr = new string[ouPathReversed.Count()];
+ for (int i = ouPathReversed.Count() - 1; i >= 0; i--)
+ {
+ ouPathArr[ouPathReversed.Count() - 1 - i] = ouPathReversed[i];
+ }
+
+ string finalPath = string.Empty;
+ foreach (string split in ouPathArr)
+ {
+ if (split.Substring(0, 2).ToLower().Equals("ou"))