Skip to content

Commit

Permalink
Initial commit with basic LDAP search
Browse files Browse the repository at this point in the history
  • Loading branch information
jzetterman committed Apr 27, 2024
0 parents commit 9f9f650
Show file tree
Hide file tree
Showing 28 changed files with 325 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "adreporting.sln"
}
22 changes: 22 additions & 0 deletions adreporting.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "adreporting", "adreporting\adreporting.csproj", "{21E61748-E8E7-4262-B332-25CE460946B2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{21E61748-E8E7-4262-B332-25CE460946B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21E61748-E8E7-4262-B332-25CE460946B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21E61748-E8E7-4262-B332-25CE460946B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21E61748-E8E7-4262-B332-25CE460946B2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
29 changes: 29 additions & 0 deletions adreporting/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// See https://aka.ms/new-console-template for more information
// Console.WriteLine("Hello, World!");

using System.ComponentModel.DataAnnotations;
using System.Reflection.PortableExecutable;
using System.DirectoryServices.AccountManagement;

DirectoryEntry directoryEntry = new DirectoryEntry("LDAP://ua.ad.alaska.edu");
DirectorySearcher searcher = new DirectorySearcher(directoryEntry) {
PageSize = int.MaxValue,
FilterUIHintAttribute = "(&(objectCategory=person))"
}

searcher.PropertiesToLoad.Add("sn");

var result = searcher.FindOne();

if (result == null) {
return;
}

string surname;

if (result.Properties.Contains("sn")) {
surname = result.Properties["sn"][0].ToString();
Console.WriteLine(surname);
} else {
Console.WriteLine("No user found!");
}
10 changes: 10 additions & 0 deletions adreporting/adreporting.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
23 changes: 23 additions & 0 deletions adreporting/bin/Debug/net8.0/adreporting.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"adreporting/1.0.0": {
"runtime": {
"adreporting.dll": {}
}
}
}
},
"libraries": {
"adreporting/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
Binary file added adreporting/bin/Debug/net8.0/adreporting.dll
Binary file not shown.
Binary file added adreporting/bin/Debug/net8.0/adreporting.exe
Binary file not shown.
Binary file added adreporting/bin/Debug/net8.0/adreporting.pdb
Binary file not shown.
12 changes: 12 additions & 0 deletions adreporting/bin/Debug/net8.0/adreporting.runtimeconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
22 changes: 22 additions & 0 deletions adreporting/obj/Debug/net8.0/adreporting.AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("adreporting")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("adreporting")]
[assembly: System.Reflection.AssemblyTitleAttribute("adreporting")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

// Generated by the MSBuild WriteCodeFragment class.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5849a552f7fce97fca66136ab543aa2fc71af9cf0bd351939b61073acdcd2ad7
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = adreporting
build_property.ProjectDir = P:\adreporting\adreporting\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
8 changes: 8 additions & 0 deletions adreporting/obj/Debug/net8.0/adreporting.GlobalUsings.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2fed1aebbc644c0106b68bc84f16b3edc9292869eb7fb2fad4545886c86aafc5
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
p:\adreporting\adreporting\bin\Debug\net8.0\adreporting.exe
p:\adreporting\adreporting\bin\Debug\net8.0\adreporting.deps.json
p:\adreporting\adreporting\bin\Debug\net8.0\adreporting.runtimeconfig.json
p:\adreporting\adreporting\bin\Debug\net8.0\adreporting.dll
p:\adreporting\adreporting\bin\Debug\net8.0\adreporting.pdb
p:\adreporting\adreporting\obj\Debug\net8.0\adreporting.GeneratedMSBuildEditorConfig.editorconfig
p:\adreporting\adreporting\obj\Debug\net8.0\adreporting.AssemblyInfoInputs.cache
p:\adreporting\adreporting\obj\Debug\net8.0\adreporting.AssemblyInfo.cs
p:\adreporting\adreporting\obj\Debug\net8.0\adreporting.csproj.CoreCompileInputs.cache
p:\adreporting\adreporting\obj\Debug\net8.0\adreporting.dll
p:\adreporting\adreporting\obj\Debug\net8.0\refint\adreporting.dll
p:\adreporting\adreporting\obj\Debug\net8.0\adreporting.pdb
p:\adreporting\adreporting\obj\Debug\net8.0\adreporting.genruntimeconfig.cache
p:\adreporting\adreporting\obj\Debug\net8.0\ref\adreporting.dll
Binary file added adreporting/obj/Debug/net8.0/adreporting.dll
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1e85c8e6293cb3a7cc5c266263afa0b745f4ded1a4dfc256f57b1e144e6b2264
Binary file added adreporting/obj/Debug/net8.0/adreporting.pdb
Binary file not shown.
Binary file added adreporting/obj/Debug/net8.0/apphost.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
66 changes: 66 additions & 0 deletions adreporting/obj/adreporting.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"format": 1,
"restore": {
"P:\\adreporting\\adreporting\\adreporting.csproj": {}
},
"projects": {
"P:\\adreporting\\adreporting\\adreporting.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "P:\\adreporting\\adreporting\\adreporting.csproj",
"projectName": "adreporting",
"projectPath": "P:\\adreporting\\adreporting\\adreporting.csproj",
"packagesPath": "C:\\Users\\jmzetterman\\.nuget\\packages\\",
"outputPath": "P:\\adreporting\\adreporting\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\jmzetterman\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.204/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}
15 changes: 15 additions & 0 deletions adreporting/obj/adreporting.csproj.nuget.g.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\jmzetterman\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.9.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\jmzetterman\.nuget\packages\" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions adreporting/obj/adreporting.csproj.nuget.g.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
71 changes: 71 additions & 0 deletions adreporting/obj/project.assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"version": 3,
"targets": {
"net8.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net8.0": []
},
"packageFolders": {
"C:\\Users\\jmzetterman\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "P:\\adreporting\\adreporting\\adreporting.csproj",
"projectName": "adreporting",
"projectPath": "P:\\adreporting\\adreporting\\adreporting.csproj",
"packagesPath": "C:\\Users\\jmzetterman\\.nuget\\packages\\",
"outputPath": "P:\\adreporting\\adreporting\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\jmzetterman\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.204/PortableRuntimeIdentifierGraph.json"
}
}
}
}
8 changes: 8 additions & 0 deletions adreporting/obj/project.nuget.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "u8AO9YPbHJkZ/CFhg5JZK+mQj8H3A8mhRE5mIxwyBFEURZfGRXH7H/A6Jr6nph0Yl4YtgbrIqyrJmDKdnj1e/w==",
"success": true,
"projectFilePath": "P:\\adreporting\\adreporting\\adreporting.csproj",
"expectedPackageFiles": [],
"logs": []
}

0 comments on commit 9f9f650

Please sign in to comment.