Giter Club home page Giter Club logo

diagrammer.microsoft.ad's Issues

Domain and Trust Diagram

Description

Add a new diagram documenting Active Directory Domain and Trust.

Example:
image

Additional Context

No response

Before submitting

  • I have read the documentation, and referred to the known issues before submitting this change request.
  • I have checked for previously opened & closed issues before submitting this change request.

Add Site Replication Topology Diagram

Description

Code:

$b = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().Sites | Select-Object name,@{l='links';e={$x=$_.name;$_.sitelinks.Sites|where name -ne $x}}
graph sitereplication @{rankdir='LR'}{
    Node @{shape='rect'}

    $edgeparam = @{
        node = $b
        fromscript  = {$_.name}
        toscript = {$_.links}
    }

    Edge @edgeparam

} | Show-PSGraph

Example:
image

Additional Context

digraph sitereplication {
    rankdir="TB";
    compound="true";
    node [shape="rect";]
    "Pharmax-HQ"->"Dead-Site"
    "Pharmax-HQ"->"Cayey-Branch"
    "Pharmax-HQ"->"ACAD"
    "Pharmax-HQ"->"UIA"
    "Cayey-Branch"->"Dead-Site"
    "Cayey-Branch"->"Pharmax-HQ"
    "ACAD"->"Pharmax-HQ"
    "Dead-Site"->"Cayey-Branch"
    "Dead-Site"->"Pharmax-HQ"
    "UIA"->"Pharmax-HQ"
}

gnjmasjh q25

Before submitting

  • I have read the documentation, and referred to the known issues before submitting this change request.
  • I have checked for previously opened & closed issues before submitting this change request.

Validate if the extension is the right one based on the file name provided

Bug description

There are cases where if you provide a file name (output.svg) and format (.png) the output file is in png format, but has the svg extension.

It is necessary to validate the format and extension to make sure they are correct. If not, the script should terminate (throw)....

Command-line input

new-addiagram -Target server-dc-01v.pharmax.local -Credential $Cred -Format png -DiagramType Sites -Direction top-to-bottom -OutputFolderPath C:\Users\jocolon -Filename outputpng.svg -Rotate 180

Steps to reproduce

  1. run the script with the $format set to svg and the filename set to output.png
  2. the image is create but the extension are wrong

Expected behaviour

Validates whether the $Format and file extension match

Screenshots

No response

Operating System

Windows 10

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.19041.3803
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.3803
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PowerShell Modules

Name                    Version  
----                    -------
Diagrammer.Microsoft.AD 0.2.1
PSGraph                 2.1.38.27

Additional Context

PS C:\Users\jocolon> new-addiagram -Target server-dc-01v.pharmax.local -Credential $Cred -Format png -DiagramType Sites -Direction top-to-bottom -OutputFolderPath C:\Users\jocolon -Filename outputpng.svg -Rotate 180
Please wait while the Microsoft.AD diagram is being generated.
PS C:\Users\jocolon> 
Microsoft.AD diagram 'outputpng.svg' has been saved to 'C:\Users\jocolon'
PS C:\Users\jocolon> 

Before submitting

Add watermark support

Description

Investigate if there is a way to add a watermark to the output image.

Additional Context

string root = HttpContext.Current.Server.MapPath("~/Images/download.jpg");    
System.Drawing.Image bitmap = (System.Drawing.Image)Bitmap.FromFile(root); // set image     
Font font = new Font("Arial", 20, FontStyle.Italic, GraphicsUnit.Pixel);    
Color color = Color.FromArgb(255, 255, 0, 0);    
Point atpoint = new Point(bitmap.Width / 2, bitmap.Height / 2);    
SolidBrush brush = new SolidBrush(color);    
Graphics graphics = Graphics.FromImage(bitmap);    
StringFormat sf = new StringFormat();    
sf.Alignment = StringAlignment.Center;    
sf.LineAlignment = StringAlignment.Center;    
graphics.DrawString("Madan S B", font, brush, atpoint, sf);    
graphics.Dispose();    
MemoryStream m = new MemoryStream();    
bitmap.Save(m, System.Drawing.Imaging.ImageFormat.Jpeg);    
byte[] convertedToBytes = m.ToArray();    
string saveto= HttpContext.Current.Server.MapPath("~/Images/test.jpg");    
System.IO.File.WriteAllBytes(saveto, convertedToBytes );   

Before submitting

  • I have read the documentation, and referred to the known issues before submitting this change request.
  • I have checked for previously opened & closed issues before submitting this change request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.