Dad of a female “Boy” Scout

————————————————————
(this is long but I hope you can find time to read).
#dadofafemaleboyscout
——————–
Kaylee Age 6 Cub Scouts

Let me preface this conversation than I am a conservative. I fight the good fight for constitutional rights, small government, and a Jesus first lifestyle.

I’m not claiming I am some saint or that I think we should accost people for their sins. Just that generally most would say I am politically conservative guy.

So when Boy Scouts said that they were going to start accepting girls, I like many of my peers really objected to that. I mean it’s Boy Scouts right? I can see the argument, there’s a girl scouts for a reason right? There’s other organizations for girls right? And so I was against it.

I’m still not sure it was the right decision to make but I’m getting there

——————–

First let’s talk about the geopolitical situation.

When we talk about the Organization of the Scouting Movement— the worldwide governing party that deals with 169 countries, the United States along with such wonderful places as Sudan, Saudi Arabia, Swaziland, Barbados, and Papua New Guinea – are the only ones that worried about gender.

I mean really, is there any other situation where conservatives would say they want the United states to be more like Saudi Arabia?

Maybe on oil production.

But certainly not on women’s rights.

As a conservative I might believe that it’s my duty as a man to provide and protect my family, and that is my wife’s duty to nurture our family, but no means do I believe that she has any less rights than I do.

In fact every conservative man I know would tell you that he is the king of his castle and his wife gives him permission to say so.

I mean come now, we’re conservatives… the party of respect your mother. So how is it that we’re lumped in with countries that don’t believe in women’s rights when it comes to scouting? That’s definitely cracking the shell for me.

——————–

Second, the boy scouts have often been a pathway to the military service. Which I think is Honorable, but let’s face it there are a lot of women in the military these days.

( Now the scouts believe in actual equality of effort and earning the badge requires doing the skill. It’s not one badge for girls and one badge for boys. You either can do it or you can’t. The military can learn a lesson there…)

But the fact remains that I would not be disappointed if my daughter join the Navy someday and following the steps of family like my brothers, cousins, uncles, dad and my grandfathers, and great grandfathers. Hypocritical of me to say she’s good enough to join the Navy but can’t join Boy Scouts. In both cases she’s a girl in a boys world.

——————–

Third – there’s the Girl Scouts. Common misconception, the Girl Scouts has nothing to do with the Boy Scouts. They are completely separate and now competing organizations

I was ok with girl scouts as a conservative, or at least as much as I could be… so we investigated

The local troop near me told us flat out that they’re expecting kids to sell thousand box of cookies. Now I understand those cookies are damn good, and it probably isn’t that hard to sell a thousand boxes. But is that really the focus that I want my daughter to deal with? I want her to be an anesthesiologist or a financial Trader. Not yet another pretty face selling something. No wonder every sales rep out there is a former Girl Scout… They learn it at a young age.

I didn’t give up on GSUSA… my mom said when she was a girl scout they did camping. My wife says she did camping with her mom. I wanted to keep a girl in girl scouts…

A little bit of research and I find a number of discussion boards where parents are fighting the same problem. The Girl Scouts in their area I’ve become about being a social club, with very little in the way of outdoor skills or activities.

And girl scouts are recognizing the problem… They added 23 badges in STEM and Outdoors. Wow… It’s 2018 and you finally think girls can do science? How progressive of you GSUSA.

I am glad GS are changing in response to Boy scouts…but i would have been a lot happier if it was proactive to create better women for the future – rather than a response to a drop in membership.

So I am sure there are Girl Scouts out there that or just as adventurous as Boy Scouts. They just don’t seem exist in my area. the affluent in my area, probably don’t have any desire to go camping. So they’re not having their kids go camping or fishing or tying knots or playing in the mud. And the poor in the area can’t afford boy or girl scouts ( the start-up fees is about $300 all said and told)

Lastly – it seems the girl scouts have taken a stance on politics that is just to the left of BSA – which is already too liberal for my tastes. I think kids organizations should stay out of politics..

Maybe in a few years we can reevaluate GSUSA.

——————–

Fourth; We also looked into some of the other christian-based organizations like American Heritage girls and Frontier girls. Unfortunately none of them have chapters in our area. Kind of makes it hard to join if I have to drive an hour and a half to meetings. Not going to happen on school nights.

——————–

My daughter on the other hand keeps asking about camping and fishing and going places. I just had just given up, I figured I’d take her a couple times a year and we’d make do with just that. I mean after all, I felt like i had exhausted my options and I knew how to teach some of what she wanted.

And then 2 weeks ago my daughter came home from school and said I want to join Boy Scouts.

” There’s one at my school.” she says….

It turns out that at least in my area – now that boy scouts is open to all.. It’s OK to promote it at the public schools.

When my 6 year old asked.. I suddenly knew that my life is going to be utterly changed, and that my stubbornness might have to be compromised to give my daughter the support that she deserves. I was going to have a daughter in an organization I felt should be boys only. Man did I feel like a hypocrit.

So Egg on the face – I go to the meeting. After all I am a dad first, and as a conservative I believe in participating as a parent. What kind of man would I be if I let my pride keep her from what she saw as a solution.

How do we teach our girls to fight gender stereotypes if we’re unwilling to get outside of our own comfort zones and do the same? Lead from the front by setting the example.

Besides Pride is a sin ya’ll.

——————–

So we went to the pack meeting and we joined, there are about eight girls and about 12 boys in total. Certainly not a large pack. It seems they where kicked out of the previous church over gays… (different story – skip the comments please). So I am joining a pack right in the middle of literal chaos caused by much of the decisions like letting my daughter join.

So far it’s been an uphill battle.

The first night we joined I get told by a pack leader – “they didn’t want girls in Boy Scouts.”

We didn’t live that deter us. They meet practically right next door to our home and so my wife and I certainly can’t argue with the convenience, and besides, I do believe in equality under the law , and so I will be damned if I am not going to defend my daughters right to have fun.

In the two weeks we’ve been members I’ve been told three or four times by friends and family that they just can’t support the girl in Boy Scouts.

On the other hand I’ve had people jump out and say “you go get them!”; “She’s a trailblazer!”; “I’m so proud of her”; “I know she’s going to do great things!” (thank God for those friends)

My kid just wants to camp and do things outdoors. She’s six she’s not thinking about boys and girls. To her there’s no difference, I mean she knows that boys stand up to pee and that girls sit… but to her a kid as a kid. She doesn’t care if the people she’s playing games with or competing against are boys or girls. She just happy to be part of the adventure.

——————–

Our first camp out I got to talk to some of the other parents and leaders from other troops. It’s interesting … Boy Scouts is allowed troops to choose to be either traditional or coed. And there are separations between the Boys & Girls by Den, remember this is Cub Scouts not Boy Scouts, and once there the 12 and up age bracket, they have to be in completely separate packs in their own campsites excetera.

One parent told me they where okay with girls being Scouts so long as “the boys and girls camped on different weekends”, after all she said we know teenagers are “going to sneak off in the middle night and end up in each other’s tents” .

I am not dumb enough to think that teenagers don’t think about other teenagers or sneak off in the middle of night… But let’s face it there’s some parental responsibility on raising your kid correctly in the situation.

There are things you can do to ensure that the girls stay in the girls camp in the boys stay in the boys camp. And if that means I need to stay up all night and watch over them, then so be it. That’s called being responsible parent.

Besides you don’t think your kids going to the mall to play Pokemon go do you? We can’t prevent our teens from interacting with other teens.

I’d much rather that interaction be in a structure where somebody said hey these are the rules and you need to follow them. Learning to respect the girls will go much further towards making good men out of our boys than isolating them. We can teach them to respect women without demasculating them too. I still understand that boys need to be boys and girls need to be girls.

Another parent told me that they had kept their pack traditional. Ironically that particular parent had a Boy Scout with a younger sister who was a tag along for the weekend.

In Cub Scouts the parents are required to attend campouts. You can’t leave your child with a leader until they’re a weblo.

So in deference to all the parents who have no choice but to bring their siblings along, Cub Scouts has generally allowed siblings along so long as they obey all the rules.

Entire generations of girls have grown up alongside their older and younger brothers, doing scouting activities, learning the same knots, building the same fires, sleeping in the same tents, playing the same games and and being held to the standards of a scout, but they didn’t get any of the credit or reward.

And no parents were complaining about it because it was expected of the parents to keep their children in line with the Boy Scout standards.

This huge irony just screams to me … I mean is Boy Scouts really just for boys If we’re already allowing female siblings to attend?

And what kind of message is that sending to the girls that the boys can earn Badges and rewards the effort, but you’re just a tag-along. Wow that’s a little too 1950 even for me as a conservative.

——————–

Lastly I looked around and realized that probably 80% of the leadership was women. So we’re okay with boys being raised and lead by women… Women that themselves couldn’t be part of the program as kids. I talked to several of them and they all told me a similar story. As a child they attended Cub Scouts with a brother, and loved it. So when their child asked to join Scouts and their request for leadership was asked of them they volunteered. Because they love what the program is about.

Another gentleman who was listening in to my discussion, told me that he was a 4th generation Scout. He was a leader in Scouts not because he really loves scouting, because like any family tradition it was nearly expected of him.

He said he had grown to love it as his son had grown to love scouting, it was their time together and for that reason alone, he said he would do anything necessary to make sure his pack was a success.

So we have women in the same generational situation, the children of scouts, but couldn’t be Scouts themselves.

Maybe in the future my daughter’s great-grandchild will look back and say hey I’m a 4th generation Scout.

——————–

The last argument that I had to deal with was among corporate culture. It’s ironic that in a world where people talk about the glass ceiling, it’s the women who are telling me most often the girls don’t belong in the boys club.

I understand that boys and girls have differences. My daughter has physical limitations compared to some boys for sure, but nothing in the terms of equality of spirit or intelligence that will limit her from doing anything a boy can do. And let’s face it, women have a higher pain tolerance and a better at multitasking in general than men. It’s okay that not everybody is meant to have the exact same skill-set.

But I have to wonder if her near future of obstacles in relation to her gender as a minority girl in a boys club, might prepare her well for a world where she may be a woman truly breaking into an industry that is mostly male whatever that might be. Maybe so, it certainly isn’t going to hurt her to have to learn to deal with the opposite sex.

——————–

Our first camp out ended with two boys and a girl playing in the rain. I don’t think any of them cared about the others gender. They were much more concerned about when the burgers would be ready to eat. And how much longer they would be allowed to stay before having to head out . Those are the memories I hope all of our kids take home. Friends family food and fun – and maybe they will never have to know about the geopolitics that their parents were dealing with…

——————–

In closing, I would love to see my daughter go all the way to Eagle… Though I’m not sure it will open the doors for her that it would have if she was a boy, but I’d like to think that 12 years in the future people have gotten over the issue of the fact that it’s Scouts now and not just boys.

We have a long way to go, she’s just a kindergarten “lion” today, and I’m not sure if we’ll stay with Boy Scouts forever.

But if we leave BSA it won’t be because Dad wasn’t willing to swallow his pride and support a girl in “boy” scouts.

Time will tell and I hope you all can give us your support.

Powershell function for sending email

Sending email is a common task.. here is a simple but functional …Function 🙂


function sendMail($BODYemail,$SUBemail,$TOemail) {

Write-Host "Sending Email"

#SMTP server name
$smtpServer = "smtpserver.MYDOMAIN.COM"

#Creating a Mail object
$msg = new-object Net.Mail.MailMessage

#Creating SMTP server object
$smtp = new-object Net.Mail.SmtpClient($smtpServer)

#Email structure
$msg.From = "FROMEMAIL@MYDOMAIN.COM"
$msg.ReplyTo = "REPLYTOEMAIL@MYDOMAIN.COM"
$msg.To.Add("$TOemail")
$msg.subject = "$SUBemail"
$msg.body = "$BODYemail"
$msg.IsBodyHTML = $true

#Sending email
$smtp.Send($msg)

}

Send some info

# To the User
$TOemail = "$OBJ_ContactPointEmail"
$BODYemail = $MSG_Header + $MSG_USERBODY + $MSG_Foot
$SUBemail = "Follow-up information on your request [$INVAR_SR]"

sendMail $BODYemail $SUBemail $TOemail

If ($INT_CountSAG -ne 0 )
{
$TOemail = "MYEMAIL@MYDOMAIN.COM"
$BODYemail = $SAGMessage
$SUBemail = "SAG Follow up"
sendMail $BODYemail $SUBemail $TOemail
}

If ($INT_CountErrors -ne 0 )
{
$TOemail = "MYEMAIL@MYDOMAIN.COM"
$BODYemail = $MSG_ERRORBODY + $MSG_SAGADMIN
$SUBemail = "Add users to groups errors"
sendMail $BODYemail $SUBemail $TOemail
}

Getting Started with powershell

When I first heard about PowerShell (an eternity ago), I basically ignored it. I thought – “My Batch files and VBScripts work just fine.”

However – as more and more Microsoft tools began to transition to utilizing PowerShell I took it upon myself to learn.

Now.. I can’t imaging going back to simple VBScript (.. I admit I still have some VB I still use.. because those scripts still work!)

So how does one get started learning PowerShell?

1. Pick a project: You need a project in order to focus your mind. If you just try to jump out and read commands – all that will do is familiarize you, and that’s essential tool, but it won’t get it cemented into your brain. So think of something simple you want to do. For our sample – lets do something simple:

  • Get all the people in an active directory group.

2. Type it up: In your mind, break down the steps of what you want to do in as many steps as you can think of – think like a computer, what does it need to do to get the info you want. For our example:

  • define a group name to a variable
  • query ad for the group
  • look up the members of the group
  • display the members

3. Documented Code: One of the nice thing about doing this is that it helps you formulate your thoughts on what needs to happen in small workable chunks. Another is that you can use your comments as the beginning of comments for your code. It’s always important to comment your code, because when others review it – it will help them follow along…. including when that other is yourself 6 months later trying to revise your own code! In powershell we use the # sign to document a comment

  • # define a group name to a variable
  • # query ad for the group
  • # look up the members of the group
  • # display the members

4. Replace ideas with Code: The next step is to replace the ideas – with actual powershell. Don’t hesitate to use your favorite search engine and look up how to do each component.


# define a group name to a variable
$MYGROUPNAME = "Test-Group"

# query ad for the group
$MYGROUPOBJECT = get-adgroup -Identity $MYGROUPNAME -Properties *

# look up the members of the group
$MYGROUPMEMBERS = $MYGROUPOBJECT.members

# display the members
echo $MYGROUPMEMBERS

This is a simple script (and it could be a lot simpler – one line in fact), but as you learn – the principles of how to learn stay the same. Break it down into smaller components and take it one section at a time until you are familiar with coding in PowerShell!

“Stop and do it right the first time”

… so like any homeowner I’ve had to fix a toilet or two in my time.  When a task comes up at work – I am the guy who is always saying “stop and do it right the first time”… so of course I am also the guy who doesn’t take his own advice on household chores.

So back to my toilet.   The tank was constantly running.  It’s a 15 year old toilet so I knew right away that the parts in the tank with the “5 year warranty” probably needed replacing…   Call me “Powers of Deduction Man!” – my superpower is knowing the obvious.

So I run off to my local Home Depot and get a kit… do i get  complete kit? nah. I grab the kit with just the most common pieces.

An hour later i’ve replaced the parts, and while things are better – I have a slow leak from the top tank into the bowl (not the floor thankfully).  Which I attempt to patch.     Six months later… my leak is back.  And it quickly gets … worse.

So back to Home depot for the … other half of the kit.    So kids – the lesson here..

“Stop and do it right the first time”

… back online after 20 years.

Sometime back in the 90s a friend and I ran a blog on this address.  It was much more difficult back then  – you had to code the website locally and FTP it up.   The other guy, Matt, and I used this blog to talk about the best beer specials in town.  I mean… what else do a pair of college guys blog about?    We tried to collate the bars running sales and specials in one place – and we even managed to get 2-3 advertising sponsors.  You know – old school advertisements,  add their Image to your page with an <img> Tag and maybe they cut you a check eventually?  I don’t think we ever even covered the $15 tag – but it was fun and we learned where to drink cheap beer.   I was the tech guy, and Matt tried to locate specials.   Matt is long gone…

..but I kept this site for email all these years.

So here I am a dad and husband, and I don’t drink like in those days – so I will limit these posts to my other passions.   These days – 24/7 isn’t about beer sales – but rather, my life as a Dad, Husband, Son, Friend, Homeowner, and IT support guy..

 

 

 

So … Welcome back to Atlanta… 24/7

 

A list of user info..

One of the things we commonly need is a list of user info. Putting that together in code is easy – but if we want a nice output to send to users? This does that.

$InputSAM = "SAMACCOUNTNAME"

############################
##
## Get user object
##
############################
$ObjUser = Get-ADUser -Identity $InputSAM -Properties *

############################
##
## Get user's manager Object
##
############################

$UserManager = $ObjUser.Manager
$ObjUserManager = Get-ADUser -Identity $UserManager -Properties OfficePhone,title

############################
##
## Zig the Zagged Data
##
############################

$DCS = Get-ADDomainController -Filter *
$NOW = Get-Date

#######################################
##
## HTML Stuff
##
######################################
$Goodgreen = "LimeGreen"
$name = $ObjUser.DisplayName

# TABLE

$tableHeader = "

"
$tableEnd = "
User Information for: " + $name + "

"
$line = "

"
$TableRow = "

"

# Cell

$CellStart = "

"
$defaultcolorCell = $TableBody + $CellStart + $Goodgreen + $cellMiddle1

### example
# $DistinguishedNameTitle = "Distinguished Name:"
# $DistinguishedNameColor = $Goodgreen
# $DistinguishedNamedata = $DistinguishedName
# $DistinguishedNameCells = $CellStart + $DistinguishedNameColor + $cellMiddle1 + $DistinguishedNameTitle + $Cellmiddle2 + $DistinguishedNamedata + $cellend

# $TableBody = $TableBody + $CellStart + $DistinguishedNameColor + $cellMiddle1 + $DistinguishedNameTitle + $Cellmiddle2 + $DistinguishedNamedata + $cellend

############################
##
## Data to return
##
############################

# start our Table body with a new line and a row

[string]$TableBody = $line + $TableRow

##################################################
# Who info

$name = $ObjUser.DisplayName
$nametitle = "Display Name: "
$namedata = $ObjUser.DisplayName
$TableBody = $TableBody + $defaultcolorCell + $NameTitle + $Cellmiddle2 + $Namedata + $cellend

$UserSAM = $objuser.SamAccountName
$UserSAMtitle = "Login: "
$UserSAMdata = $UserSAM
$TableBody = $TableBody + $defaultcolorCell + $UserSAMtitle + $Cellmiddle2 + $UserSAMdata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$title = $objuser.Title
$titletitle = "Title: "
$titledata = $title
$TableBody = $TableBody + $defaultcolorCell + $titletitle + $Cellmiddle2 + $titledata + $cellend

$Description = $ObjUser.Description
$Descriptiontitle = "Prefered Title: "
$Descriptiondata = $Description
$TableBody = $TableBody + $defaultcolorCell + $Descriptiontitle + $Cellmiddle2 + $Descriptiondata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$employeedepartment = $ObjUser.Department
$employeedepartmenttitle = "Department: "
$employeedepartmentdata = $employeedepartment
$TableBody = $TableBody + $defaultcolorCell + $employeedepartmenttitle + $Cellmiddle2 + $employeedepartmentdata + $cellend

$Company = $ObjUser.Company
$Companytitle = "Company: "
$Companydata = $Company
$TableBody = $TableBody + $defaultcolorCell + $Companytitle + $Cellmiddle2 + $Companydata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$DistinguishedName = $ObjUser.DistinguishedName
$DistinguishedNameTitle = "Distinguished Name: "
$DistinguishedNamedata = $ObjUser.DistinguishedName
$TableBody = $TableBody + $defaultcolorCell + $DistinguishedNameTitle + $Cellmiddle2 + $DistinguishedNamedata + $cellend

##################################################
# Employee Details

#new Line
$TableBody = $TableBody + $line

#Section header
$TableBody = $TableBody + "

"

#new Line
$TableBody = $TableBody + $line

#new Row
$TableBody = $TableBody + $TableRow

$officephone = $objuser.OfficePhone
$officephonetitle = "Office Phone: "
$officephonedata = $officephone
$TableBody = $TableBody + $defaultcolorCell + $officephonetitle + $Cellmiddle2 + $officephonedata + $cellend

$homephone = $ObjUser.HomePhone
$homephonetitle = "Home or Cell: "
$homephonedata = $homephone
$TableBody = $TableBody + $defaultcolorCell + $homephonetitle + $Cellmiddle2 + $homephonedata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$employeeID = $objuser.EmployeeID
$employeeIDtitle = "Employee ID: "
$employeeIDdata = $employeeID
$TableBody = $TableBody + $defaultcolorCell + $employeeIDtitle + $Cellmiddle2 + $employeeIDdata + $cellend

$employeetype = $ObjUser.employeeType
$employeetypetitle = "Account Type: "
$employeetypedata = $employeetype
$TableBody = $TableBody + $defaultcolorCell + $employeetypetitle + $Cellmiddle2 + $employeetypedata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$location = $ObjUser.Office
$locationtitle = "Office: "
$locationdata = $location
$TableBody = $TableBody + $defaultcolorCell + $locationtitle + $Cellmiddle2 + $locationdata + $cellend

$email = $ObjUser.EmailAddress
$emailtitle = "Email: "
$emaildata = $email
$TableBody = $TableBody + $defaultcolorCell + $emailtitle + $Cellmiddle2 + $emaildata + $cellend

###########################################
###
### We need to pause and Get the multi DC stuff
###
##############################################

$LastLogintime = 0
$DefenderLastLogintime = 0
$DCLastFailedLogintime = 0
$BadLogins = 0
$accountchangedtime = 0

foreach($dc in $dcs)
{
$hostname = $dc.HostName
$LocalDCuser = Get-ADUser $UserSAM -Server $hostname | Get-ADObject -Properties *

if($LocalDCuser.'defender-lastLogon' -gt $DefenderLastLogintime)
{
$DefenderLastLogintime = $LocalDCuser.'defender-lastLogon'
}
if($LocalDCuser.LastLogon -gt $LastLogintime)
{
$LastLogintime = $LocalDCuser.LastLogon
}
if($LocalDCuser.BadPasswordTime -gt $DCLastFailedLogintime)
{
$DCLastFailedLogintime = $LocalDCuser.BadPasswordTime
}

if($LocalDCuser.whenChanged -gt $accountchangedtime)
{
$accountchangedtime = $LocalDCuser.whenChanged
}

if($LocalDCuser.BadLogonCount -gt $BadLogins)
{
[string]$BadLogins = $LocalDCuser.BadLogonCount
}
}
$LastSuccessfulLogin = [DateTime]::FromFileTime($LastLogintime)
$DefenderLastSuccessfulLogin = [DateTime]::FromFileTime($DefenderLastLogintime)
$lastfailedlogin = [DateTime]::FromFileTime($DCLastFailedLogintime)
$Acctchanged = $accountchangedtime

# Echo $username
# Echo "last logged on at: " $LastSuccessfulLogin
# Echo "last logged on with Defender token at: " $DefenderLastSuccessfulLogin
# Echo "last FAILED log on at: " $lastfailedlogin
# Echo "Recent Bad Logins: " $BadLogins
#

###################################################
# Oddball Account Properties
#new Line
$TableBody = $TableBody + $line

#new Row
$TableBody = $TableBody + $TableRow

$AcctCreated = $ObjUser.whenCreated
$AcctCreatedtitle = "Account Creation Date: "
$AcctCreateddata = $ObjUser.whenCreated
$TableBody = $TableBody + $defaultcolorCell + $AcctCreatedtitle + $Cellmiddle2 + $AcctCreateddata + $cellend

$Acctchangedtitle = "Account Last Changed: "
$Acctchangeddata = $Acctchanged
$TableBody = $TableBody + $defaultcolorCell + $Acctchangedtitle + $Cellmiddle2 + $Acctchangeddata + $cellend

###################################################
# Login times and Status

#new Line
$TableBody = $TableBody + $line

#Section header
$TableBody = $TableBody + "

"

#new Line
$TableBody = $TableBody + $line

#new Row
$TableBody = $TableBody + $TableRow

$LastSuccessfulLogintitle = "Last Successful Login: "
$LastSuccessfulLogindata = $LastSuccessfulLogin
$TableBody = $TableBody + $defaultcolorCell + $LastSuccessfulLogintitle + $Cellmiddle2 + $LastSuccessfulLogindata + $cellend

$DefenderLastSuccessfulLogintitle = "Last Defender Token Login: "
$DefenderLastSuccessfulLogindata = $DefenderLastSuccessfulLogin
$TableBody = $TableBody + $defaultcolorCell + $DefenderLastSuccessfulLogintitle + $Cellmiddle2 + $DefenderLastSuccessfulLogindata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$lastfailedlogintitle = "Last Failed Login: "
$lastfailedlogindata = $lastfailedlogin
$TableBody = $TableBody + $defaultcolorCell + $lastfailedlogintitle + $Cellmiddle2 + $lastfailedlogindata + $cellend

################################################################
## account status

#new Line
$TableBody = $TableBody + $line

#Section header
$TableBody = $TableBody + "

"

#new Line
$TableBody = $TableBody + $line

#new Row
$TableBody = $TableBody + $TableRow

########## Account locked processing
$AcctLocked = $ObjUser.LockedOut
switch($AcctLocked)
{
True
{
$AccountLockedColor = "Red"
}
False
{
$AccountLockedColor = "LimeGreen"
}
}

$AcctLockedtitle = "Account Locked: "
$AcctLockeddata = $AcctLocked
$TableBody = $TableBody + $CellStart + $AccountLockedColor + $cellMiddle1 + $AcctLockedtitle + $Cellmiddle2 + $AcctLockeddata + $cellend

######### account control processing

$AccountControl = $ObjUser.userAccountControl
switch($AccountControl)
{
512
{
$accountDisabled = "False"
$accountDisabledColor = "LimeGreen"
$passwordexpires = "True"
$passwordexpirescolor = "LimeGreen"
}
514
{
$accountDisabled = "True"
$accountDisabledColor = "Red"
$passwordexpires = "True"
$passwordexpirescolor = "LimeGreen"
}
66048
{
$accountDisabled = "False"
$accountDisabledColor = "LimeGreen"
$passwordexpires = "false"
$passwordexpirescolor = "DarkOrange"
}
66050
{
$accountDisabled = "True"
$accountDisabledColor = "Red"
$passwordexpires = "false"
$passwordexpirescolor = "DarkOrange"
}
}

$accountDisabledtitle = "Account Disabled: "
$accountDisableddata = $accountDisabled
$TableBody = $TableBody + $CellStart + $accountDisabledColor + $cellMiddle1 + $accountDisabledtitle + $Cellmiddle2 + $accountDisableddata + $cellend

################################################################
## password status

#new Line
$TableBody = $TableBody + $line

#Section header
$TableBody = $TableBody + "

"

#new Line
$TableBody = $TableBody + $line

#new Row
$TableBody = $TableBody + $TableRow

$pwdlastChanged = $ObjUser.PasswordLastSet
$pwdlastChangedtitle = "Password Last Set: "
$pwdlastChangeddata = $pwdlastChanged
$TableBody = $TableBody + $defaultcolorCell + $pwdlastChangedtitle + $Cellmiddle2 + $pwdlastChangeddata + $cellend

########## password age calculation
$PwdAge = ($NOW - $pwdlastChanged).days

switch($PwdAge)
{
{$_ -ge 0 -and $_ -le 45}
{
$PwdAgeColor = "LimeGreen"
}
{$_ -ge 46 -and $_ -le 55}
{
$PwdAgeColor = "Yellow"
}
{$_ -ge 56 -and $_ -le 60}
{
$PwdAgeColor = "DarkOrange"
}
{$_ -ge 61}
{
$PwdAgeColor = "Red"
}
}

$PwdAgetitle = "Password Age: "
$PwdAgedata = $PwdAge
$TableBody = $TableBody + $CellStart + $PwdAgeColor + $cellMiddle1 + $PwdAgetitle + $Cellmiddle2 + $PwdAgedata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$passwordexpirestitle = "Password Expires Policy: "
$passwordexpiresdata = $passwordexpires
$TableBody = $TableBody + $CellStart + $passwordexpiresColor + $cellMiddle1 + $passwordexpirestitle + $Cellmiddle2 + $passwordexpiresdata + $cellend

$PwdExpired = $ObjUser.PasswordExpired
switch($PwdExpired)
{
False
{
$pwdExpiredColor = "LimeGreen"
}
True
{
$pwdExpiredColor = "Red"
}
}

$PwdExpiredtitle = "Password Expired?: "
$PwdExpireddata = $PwdExpired
$TableBody = $TableBody + $CellStart + $PwdExpiredColor + $cellMiddle1 + $PwdExpiredtitle + $Cellmiddle2 + $PwdExpireddata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$UserchangePwd = $ObjUser.CannotChangePassword

switch($UserchangePwd)
{
False
{
$UserChangepwdColor = "LimeGreen"
$UserchangePwdStatus = "Yes"
}
True
{
$UserChangepwdColor = "Yellow"
$UserchangePwdStatus = "No"
}
}

$UserchangePwdtitle = "User can change password?: "
$UserchangePwddata = $UserchangePwdStatus
$TableBody = $TableBody + $CellStart + $UserchangePwdColor + $cellMiddle1 + $UserchangePwdtitle + $Cellmiddle2 + $UserchangePwddata + $cellend

# Domain Password Policy stuff
$ADDomainPasswordPolicy = Get-ADDefaultDomainPasswordPolicy

#new Row
$TableBody = $TableBody + $TableRow

[string]$maxattempts = $ADDomainPasswordPolicy.LockoutThreshold
[string]$Remainingattempts = $maxattempts - $BadLogins

$maxattemptstitle = "Max/Remaining Password Attempts: "
[string]$maxattemptsdata = $maxattempts + " / " + $Remainingattempts
$TableBody = $TableBody + $defaultcolorCell + $maxattemptstitle + $Cellmiddle2 + $maxattemptsdata + $cellend

########## calculate account unlock policy
$LockoutDuration = $ADDomainPasswordPolicy.LockoutDuration
if ($LockoutDuration -le 0)
{
$Autounlock = "Manual Unlock Only"
}
if ($LockoutDuration -gt 0)
{
$Autounlock = "[Days:Hours:Minutes] " + $LockoutDuration
}

$Autounlocktitle = "Auto Unlock Duration: "
$Autounlockdata = $Autounlock
$TableBody = $TableBody + $defaultcolorCell + $Autounlocktitle + $Cellmiddle2 + $Autounlockdata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$MinPwdlength = $ADDomainPasswordPolicy.MinPasswordLength
$MinPwdlengthtitle = "Minimum Password Length: "
$MinPwdlengthdata = $MinPwdlength
$TableBody = $TableBody + $defaultcolorCell + $MinPwdlengthtitle + $Cellmiddle2 + $MinPwdlengthdata + $cellend

$MinPwdHistory = $ADDomainPasswordPolicy.PasswordHistoryCount
$MinPwdHistorytitle = "Minimum Password History: "
$MinPwdHistorydata = $MinPwdHistory
$TableBody = $TableBody + $defaultcolorCell + $MinPwdHistorytitle + $Cellmiddle2 + $MinPwdHistorydata + $cellend

################################################################
## Profile Information

#new Line
$TableBody = $TableBody + $line

#Section header
$TableBody = $TableBody + "

"

#new Line
$TableBody = $TableBody + $line

#new Row
$TableBody = $TableBody + $TableRow

$Script = $ObjUser.ScriptPath
$Scripttitle = "Login Script: "
$Scriptdata = $Script
$TableBody = $TableBody + $defaultcolorCell + $Scripttitle + $Cellmiddle2 + $Scriptdata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$homeLocation = $ObjUser.l
$HomeDirectory = "\\microsoft.com\user\" + $homeLocation + "\" + $UserSAM + "\"
$HomeDirectorytitle = "Home Drive: "
$HomeDirectorydata = $HomeDirectory
$TableBody = $TableBody + $defaultcolorCell + $HomeDirectorytitle + $Cellmiddle2 + $HomeDirectorydata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$CitrixProfile = "\\micosoft.com\citrix\Profiles\TS\" + $UserSAM +"
" + "\\microsoft.com\citrix\Profiles\TS-x64\" + $UserSAM
$CitrixProfiletitle = "Citrix Profiles: "
$CitrixProfiledata = $CitrixProfile
$TableBody = $TableBody + $defaultcolorCell + $CitrixProfiletitle + $Cellmiddle2 + $CitrixProfiledata + $cellend

################################################################
## Exchange information

#new Line
$TableBody = $TableBody + $line

#Section header
$TableBody = $TableBody + "

"

#new Line
$TableBody = $TableBody + $line

#new Row
$TableBody = $TableBody + $TableRow

$ExchangeAccount = $ObjUser.msExchWhenMailboxCreated
$ExchangeAccounttitle = "Mailbox Created: "
$ExchangeAccountdata = $ExchangeAccount
$TableBody = $TableBody + $defaultcolorCell + $ExchangeAccounttitle + $Cellmiddle2 + $ExchangeAccountdata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$proxyaddresses = $ObjUser.proxyAddresses

Foreach ($mailitem in $proxyaddresses)
{
$mailitemlist = $mailitemlist + "
" + $mailitem
}

$proxyaddressestitle = "Messaging Addresses: "
$proxyaddressesdata = $mailitemlist
$TableBody = $TableBody + $defaultcolorCell + $proxyaddressestitle + $Cellmiddle2 + $proxyaddressesdata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$AssignedDelegates = $ObjUser.publicDelegatesBL

Foreach ($mailbox in $AssignedDelegates)
{
$objmailbox = Get-ADUser -Identity $mailbox
$mailboxname = $objmailbox.name
$Publicmailbox = $publicmailbox + "
" + $mailboxname
}

$AssignedDelegatestitle = "Assigned Delegates: "
$AssignedDelegatesdata = $Publicmailbox
$TableBody = $TableBody + $defaultcolorCell + $AssignedDelegatestitle + $Cellmiddle2 + $AssignedDelegatesdata + $cellend

$mailboxmanager = $ObjUser.msExchDelegateListBL

Foreach ($mailbox in $mailboxmanager)
{
$objmailbox = Get-ADUser -Identity $mailbox
$mailboxname = $objmailbox.name
$mailboxlist = $mailboxlist + "
" + $mailboxname
}

$mailboxmanagertitle = "Delegate Access: "
$mailboxmanagerdata = $mailboxlist
$TableBody = $TableBody + $defaultcolorCell + $mailboxmanagertitle + $Cellmiddle2 + $mailboxmanagerdata + $cellend

############################
##
## Managers Data to return
##
############################

################################################################
## Manager information

#new Line
$TableBody = $TableBody + $line

#Section header
$TableBody = $TableBody + "

"

#new Line
$TableBody = $TableBody + $line

#new Row
$TableBody = $TableBody + $TableRow

$manager = $ObjUserManager.Name
$managertitle = "Manager Name: "
$managerdata = $manager
$TableBody = $TableBody + $defaultcolorCell + $managertitle + $Cellmiddle2 + $managerdata + $cellend

#new Row
$TableBody = $TableBody + $TableRow

$managertitle = $ObjUserManager.title
$managertitletitle = "Manager Title: "
$managertitledata = $managertitle
$TableBody = $TableBody + $defaultcolorCell + $managertitletitle + $Cellmiddle2 + $managertitledata + $cellend

$managerphone = $ObjUserManager.OfficePhone
$managerphonetitle = "Manager Office Phone: "
$managerphonedata = $managerphone
$TableBody = $TableBody + $defaultcolorCell + $managerphonetitle + $Cellmiddle2 + $managerphonedata + $cellend

###################################
##
## Message
##
#############################################################################

$Message = $Message + $tableHeader + $Tablebody + $tableend

This gives us pretty output we can send to users. I hope it helps.


"
$Cellmiddle2 = "
"
$cellend = "
EMPLOYEE DETAILS
LOGIN DATES
ACCOUNT STATUS
PASSWORD INFORMATION
PROFILE INFORMATION
EXCHANGE INFORMATION
LINE MANAGER