Wednesday, March 27, 2013

Remove Stale/Old Active Sync Devices from All Mailboxes

I had an issue where several users that no longer work here still had active sync devices in AD for whatever reason so I needed to get rid of them.

Quick Google Search found this Technet thread

The long and short of it are these two lines that gather all the active sync devices that haven't checked in within the past 30 days and then removes them.

For my purposes I changed it 90 days the first time through, however I now run this script once monthly.

-- Powershell Start --

$DevicesToRemove = Get-ActiveSyncDevice -result unlimited | Get-ActiveSyncDeviceStatistics | where {$_.LastSuccessSync -le (Get-Date).AddDays("-30")}

$DevicesToRemove | foreach-object {Remove-ActiveSyncDevice ([string]$_.Guid) -confirm:$false}

-- Powershell End --

Now let's say the user doesn't have a mailbox on Exchange anymore.

You first have to temporarily recreate the mailbox

-- Powershell Start --

Enable-Mailbox -Identity:'OU/User'

-- Powershell End --

Then rerun the above script.

If you don't create the mailbox you get a can't find recipient error.

Then after the active sync devices are gone simply run

-- Powershell Start --

Remove-Mailbox -Identity:'OU/User'

-- Powershell End --

If for some reason you still can't remove the Active Sync devices you can open ADSI Edit and look for

CN=ExchangeActiveSyncDevices container under the user object

Then simply remove that.

Tuesday, March 26, 2013

A quote

A lack of scientific certainty should never be allowed to undercut our ability (and responsibility) to act on imperfect information. People who think science is certain don't understand science. We only ever have contingent knowledge - the most robust scientific thinking at a given moment - and this thinking is always subject to change. That's what makes it science. But just because the thing is imperfect does not actionable. Newtonian science is not perfect but it's enough to get us to the moon and back.

Mark Jannot - Editor-in-Chief Popular Science February 2012

Thursday, March 21, 2013

FreeBSD Update Script



This is a script I stole from someone else and modified.
It originally used portupgrade, but portmaster is better in my opinion.
The script basically looks for all out of date ports and runs through upgrading them.
Additionally it asks you to configure them and does this for all dependencies as well.

This isn't one of those set it and forget scripts you can put in crontab - you actually need to pay attention when upgrading ports and this script needs your full attention.

There a few pre-requisite things that must be addressed:
1) Make sure ports is installed or if it is installed, up to date

To Install Ports:
portsnap fetch extract

To Update Ports:
portsnap fetch update

2) Install portaudit

cd /usr/port/ports-mgmt/portaudit
make install clean

3) Install portmaster
cd /usr/ports/ports-mgmt/portmaster
make install clean

4) Create a log file /var/log/freebsd-update.log
touch /var/log/freebsd-update.log

--Script Start--
#!/bin/sh

LOG_FILE="/var/log/freebsd-update.log"

echo "Starting updates: `date`" | tee -a ${LOG_FILE}
echo "***"
echo "*** Checking for FreeBSD patches..."
echo "***"
/usr/sbin/freebsd-update fetch | tee -a ${LOG_FILE}
/usr/sbin/freebsd-update install | tee -a ${LOG_FILE}

echo "***"
echo "*** Updating ports tree..."
echo "***"
/usr/sbin/portsnap fetch update | tee -a ${LOG_FILE}

echo "***"
echo "*** Looking for ports to update..."
echo "***"
/usr/local/sbin/portmaster -a --force-config -d -b -t -v -y -t | tee -a ${LOG_FILE}

echo "***"
echo "*** Checking installed ports for known security problems..."
echo "***"
/usr/local/sbin/portaudit -Fva | tee -a ${LOG_FILE}
echo "Finished updates: `date`" | tee -a ${LOG_FILE}
--Script End--

Word of note if you need to exclude something add a -x after the -t and put in the name or partial name of a port such as:

/usr/local/sbin/portmaster -a --force-config -d -b -t -v -y -t -x LSOF | tee -a ${LOG_FILE}

You'll need to do a separate -x for each port you want to exclude.

Tuesday, January 29, 2013

Fwd: Working For a Budget in Washington and Jobs in Texas

This guy is an idiot, which is why I subscribe to the newsletter.
---------- Forwarded message ----------
From: "Senator John Cornyn" <newsletter@cornyn.enews.senate.gov>
Date: Jan 29, 2013 2:41 PM
Subject: Working For a Budget in Washington and Jobs in Texas
To: "Benjamin Warriner" <benjamin.warriner@gmail.com>
Cc:

> If you are having trouble viewing this message or would like to share it on a social network, you can view the message online.
>
> Unsubscribe - Update My Profile
>
> The Lonestar Weekly
> January 29, 2013
> SERVING TEXANS IN THE SENATE SINCE 2002
> Share on Facebook
>
> Share on Twitter
>
> No Budget, No Pay Act
>
> Click Here to Watch Video
>
>
> This week, I again cosponsored the "No Budget, No Pay" legislation, which would hold Congress accountable by requiring Members to pass a budget each fiscal year in order to receive pay.  Common sense doesn't seem all that common in Washington these days, but I think this is a sensible measure that members of Congress on both sides of the aisle can get behind, with strong support from Americans across the country. 
>
> Texas families and small businesses have to budget, and so should their government. I hope my colleagues will quickly lend their support to this legislation, which will help get us back on a fiscal track where we no longer spend money we don't have.
>
>  
>
>  
>
>  
>
> Keystone Pipeline
>
> Click Here to Watch Video
>
> This week, I also sent a letter encouraging the President to approve the Keystone XL pipeline. It has undergone more than four years of the most exhaustive environmental scrutiny of any pipeline in U.S. history, and just this week the Governor of Nebraska cleared the way for the pipeline to be routed through his state—one of the final hurdles preventing it from moving forward. Keystone XL will provide us with greater energy security, allowing us to tap into North American sources of energy and reducing our dependence on unstable nations in the Middle East.
>
> Just as important, this pipeline would create thousands of jobs, many of which would be in Texas, where the pipeline would terminate.The positive economic impact for Texas would be staggering, creating $1.6 billion of direct investment, an estimated $2 billion increase in our total economic output, and nearly $50 million dollars of increased revenue for our state.
>
> If the President is truly concerned about jobs, the economy, and energy security, he should stop stonewalling this pipeline and let it move forward as quickly as possible. 
>
>  
>
>  Fiscal Responsibility
>
> Click Here to Watch Video
>
> There are several important deadlines looming, including the debt ceiling and the across-the-board sequester of agency funds, including the Department of Defense. While no agency should be immune to spending cuts, we need to be careful to ensure that our military's mission and our national security requirements dictate the Defense budget and not the other way around.
>
> We have known about these deadlines for some time, but we have yet to see any leadership or proposals from the President that will bring both sides together to tackle these challenges. These are critical opportunities to answer the call of the American people and get serious about our nation's unsustainable debt. What we don't need is another manufactured crisis by the Obama Administration,forcing a 2:00 A.M. Senate vote. Nobody wants another cliffhanger that weakens public trust in our government or in our willingness to meet our responsibilities, and most of all no one wants another credit downgrade. It is time for the President to step forward and show real leadership that will get our nation back on a fiscally sustainable path.
>
> News Releases
>
> January 25:Cornyn Statement on 2013 March For Life
> January 23:Cornyn, Bipartisan Group of Senators Urge President To Approve Keystone XL
> January 23:U.S. Senators Cornyn and Cruz Joint Statement on Texans Killed in Algeria
> January 17:Cornyn Calls on Obama to Submit Debt Ceiling Request
> January 17:Cornyn Questions Holder Over Death of Reddit Co-Founder Aaron Swartz
> January 15:Cornyn: Closed Door Meetings, Retraction Letters Can't Erase Hagel's Record
> January 10:Cornyn Statement on Nomination of Jack Lew for Treasury Secretary
> January 10:Cornyn Op-Ed: Why I Can't Support Hagel
> January 7:Cornyn: Hagel 'Worst Possible Message' for U.S. Allies in Middle East
> January 4:Cornyn: Partial Government Shutdown May Be Needed to Restore Fiscal Sanity 
>
> Social Media
>
> Sen. Cornyn regularly updates his profiles with the latest news and developments from around Texas and Capitol Hill.
>
>      
>
> Texas Times Column
>
> December 14:Tales of Christmas Past In Texas
> November 20: A Message of Thanksgiving
> September 14: Cowtown On The Open Seas: Commissioning the USS Fort Worth
> August 29: A Texas Town with an Abundance of Books
> August 10: Back To School On The Texas Frontier
> July 27: Don't Mess With Texans' Hard-Earned Success
> July 2: Remembering The Sacrifices Behind Independence Day
> June 15: The Hero From Eden, Texas
> May 24:A Bittersweet Trip on the Honor Flight Network
> May 14:Saluting Unsung Heroes: Military Spouses
>
> TEXAS OFFICES
> WASHINGTON DC OFFICE
> Click your region to
> find the latest news and office location
> 517 Hart Senate Office Bldg.
> Washington, DC 20510
> Main: 202-224-2934
> Fax: 202-228-2856
> Unsubscribe - Update My Profile - Privacy Policy
>
>
>

Saturday, December 15, 2012

...


Authorities have released the names of the 26 victims killed when a gunman opened fire inside a Connecticut elementary school.
All six adults killed at Sandy Hook Elementary School were women. Of the 20 children who were shot to death, eight were boys and 12 were girls. All the children were ages 6 or 7.
Below is the list released by Connecticut State Police.
-- Charlotte Bacon, Female, 02-22-06 

-- Daniel Barden, Male, 09-25-05

-- Rachel Davino, Female, 07-17-83 

-- Olivia Engel, Female, 07-18-06
The images of Olivia Engel will live far beyond her short lifetime. There she is, visiting with Santa Claus, or feasting on a slice of birthday cake. There's the one of her swinging a pink baseball bat, and another posing on a boat. In some, she models a pretty white dress, in others she makes a silly face.
Dan Merton, a longtime friend of the girl's family, says he could never forget the child, and he has much to say when he thinks of her.
"She loved attention," he said. "She had perfect manners, perfect table manners. She was the teacher's pet, the line leader."
On Friday, Merton said, she was simply excited to go to school and return home and make a gingerbread house.
"Her only crime," he said, "is being a wiggly, smiley 6-year-old."
-- Josephine Gay, Female, 12-11-05

-- Ana Marquez-Greene, Female, 04-04-06
A year ago, 6-year-old Ana Marquez-Greene was reveling in holiday celebrations with her extended family on her first trip to Puerto Rico.
The girl's grandmother, Elba Marquez, said the child's family moved to Connecticut just two months ago, drawn from Canada, in part, by Sandy Hook's pristine reputation. The grandmother's brother, Jorge Marquez, is mayor of a Puerto Rican town and said the child's 9-year-old brother was also at the school, but he escaped safely.
Elba Marquez had just visited the new home over the Thanksgiving holiday and finds herself perplexed by what happened.
"It was a beautiful place, just beautiful," she said. "What happened does not match up with the place where they live."

-- Dylan Hockley, Male, 03-08-06 

-- Dawn Hochsprung, Female, 06-28-65
Dawn Hochsprung's pride in Sandy Hook Elementary was clear. She regularly tweeted photos from her time as principal. Just this week, it was an image of students rehearsing for their winter concert.
She viewed her school as a model, telling The Newtown Bee newspaper in 2010 that "I don't think you could find a more positive place to bring students to every day." She had worked to make Sandy Hook a place of safety, too, and in October, the 47-year-old Hochsprung shared a picture of the school's evacuation drill with the message "Safety first."
When the unthinkable came, she was ready to defend. Officials said she died while lunging at the gunman in an attempt to overtake him.
"She had an extremely likable style about her," said Gerald Stomski, first selectman of Woodbury, where Hochsprung lived and had taught. "She was an extremely charismatic principal while she was here."

-- Madeleine F. Hsu, Female, 07-10-06

-- Catherine V. Hubbard, Female, 06-08-06

-- Chase Kowalski, Male, 10-31-05 
Chase Kowalski was always outside, playing in the backyard, riding his bicycle. Just last week, he was visiting neighbor Kevin Grimes, telling him about completing -- and winning -- his first mini-triathlon.
"You couldn't think of a better child," Grimes said.
Grimes' own five children all attended Sandy Hook, too. Cars lined up outside the Kowalski's ranch home Saturday, and a state trooper's car idled in the driveway. Grimes spoke of the boy only in the present tense.
-- Jesse Lewis, Male, 06-30-06

-- James Mattioli, Male, 03-22-06

-- Grace McDonnell, Female, 11-04-05

-- Anne Marie Murphy, Female, 07-25-60 
A happy soul. A good mother, wife and daughter. Artistic, fun-loving, witty and hardworking.
Remembering their daughter, Anne Marie Murphy, her parents had no shortage of adjectives to offer Newsday. When news of the shooting broke, Hugh and Alice McGowan waited for word of their daughter as hour by hour ticked by. And then it came.
Authorities told the couple their daughter was a hero who helped shield some of her students from the rain of bullets. As the grim news arrived, the victim's mother reached for her rosary.
"You don't expect your daughter to be murdered," her father told the newspaper. "It happens on TV. It happens elsewhere."
-- Emilie Parker, Female, 05-12-06
Fighting back tears and struggling to catch his breath, Robbie Parker, Emilie's father, told the world about a little girl who loved to draw and was always smiling, and he also reserved surprising words of sympathy for the gunman.
"She was beautiful. She was blond. She was always smiling," he said.
To the gunman's family, he said, "I can't imagine how hard this experience must be for you."
He said he struggled to explain the death to Emilie's two siblings, 3 and 4.
"They seem to get the fact that they have somebody they're going to miss very much," he said.
Parker said his daughter loved to try new things -- except for new food. And she was quick to cheer up those in need.
"She never missed an opportunity to draw a picture or make a card for those she around her," he said.
The world is a better place because Emilie was in it, he said.
"I'm so blessed to be her dad," he said.

-- Jack Pinto, Male, 05-06-06 

-- Noah Pozner, Male, 11-20-06

-- Caroline Previdi, Female, 09-07-06

-- Jessica Rekos, Female, 05-10-06

-- Avielle Richman, Female, 10-17-06

-- Lauren Rousseau, Female, 06-?-82 
Lauren Rousseau had spent years working as a substitute teacher and doing other jobs. So she was thrilled when she finally realized her goal this year to become a full-time teacher at Sandy Hook.
"It was the best year of her life," her mother, Teresa Rousseau, told the Danbury News-Times, where she is a copy editor.
Rousseau has been called gentle, spirited and active. She was a lover of music, dance and theater.
"I'm used to having people die who are older," her mother said, "not the person whose room is up over the kitchen."

-- Mary Sherlach, Female, 02-11-56 
When the shots rang out, school psychologist Mary Sherlach, 56, threw herself into the danger.
Janet Robinson, the superintendent of Newtown Public Schools, said Sherlach and the school's principal ran toward the shooter. They lost their lives, rushing toward him.
Even as Sherlach neared retirement, her job at Sandy Hook was one she loved. Those who knew her called her a wonderful neighbor, a beautiful person, a dedicated educator.
Her son-in-law, Eric Schwartz, told the South Jersey Times that Sherlach relished helping children overcome their problems. She had planned to leave work early on Friday, he said. In a news conference Saturday, he told reporters the loss was devastating, but that Sherlach was doing what she loved.
"Mary felt like she was doing God's work," he said, "working with the children."

-- Victoria Soto, Female, 11-04-85 
She beams in photos. Her enthusiasm was evident. She was doing, those who knew her say, what she loved.
And now, Victoria Soto is being called a hero.
Though details of the 27-year-old teacher's death remain fuzzy, her name has been invoked again and again as a portrait of selflessness and humanity among unfathomable evil.
A cousin, Jim Wiltsie, told ABC News that investigators told his family she was killed while shielding her students from danger. She reportedly hid some students in a bathroom or closet, ensuring they were safe.
"She was trying to shield, get her children into a closet and protect them from harm," Wiltsie told ABC. "And by doing that, put herself between the gunman and the children."
Soto's goal was simply to be a teacher.
"She lost her life doing what she loved," Wiltsie said.
Photos of Soto show her always with a wide smile, in pictures of her at her college graduation and in mundane daily life. She looks so young, barely an adult herself. Her goal was simply to be a teacher.
"You have a teacher who cared more about her students than herself," said Mayor John Harkins of Stratford, the town Soto hailed from and where more than 300 people gathered for a memorial service Saturday night. "That speaks volumes to her character, and her commitment and dedication."

-- Benjamin Wheeler, Male, 09-12-06

-- Allison N. Wyatt, Female, 07-03-06

The Associated Press contributed to this report.


Read more: http://www.foxnews.com/us/2012/12/15/officials-release-names-victims-in-connecticut-elementary-school-shooting/#ixzz2FBCNx86J

Friday, December 14, 2012

Tragedy

I've been thinking about what happened today, but I can't think of anything to say.

So I am going to quote President Obama.

 "The majority of those who died today were children — beautiful little kids between the ages of 5 and 10 years old. They had their entire lives ahead of them — birthdays, graduations, weddings, kids of their own. Among the fallen were also teachers — men and women who devoted their lives to helping our children fulfill their dreams."

 "So our hearts are broken today — for the parents and grandparents, sisters and brothers of these little children, and for the families of the adults who were lost. ..."


I don't have a clue

I'm so very tired. It's almost all the time now.