SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Next AD Computer Account


Next AD Computer Account

Author
Message
James.Bowtell
James.Bowtell
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 19
Hi All..

I am looking to create a report that will list let’s say the next 10 available AD computer names in a specific OU

I have managed to query AD and list all the machines that are in a specific OU

Is there a function in SQL I can use to identify a sequence and generate the next computer numbers and display in a report.

Thanks in advance.
pietlinden
pietlinden
SSC Guru
SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)

Group: General Forum Members
Points: 53411 Visits: 16993
Are you talking about ROW_NUMBER()?
Sue_H
Sue_H
SSC Guru
SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)SSC Guru (74K reputation)

Group: General Forum Members
Points: 74851 Visits: 15321
James.Bowtell - Thursday, February 1, 2018 10:52 AM
Hi All..I am looking to create a report that will list let’s say the next 10 available AD computer names in a specific OUI have managed to query AD and list all the machines that are in a specific OU Is there a function in SQL I can use to identify a sequence and generate the next computer numbers and display in a report. Thanks in advance.


There is no built in function to recognize the naming pattern, convention that you use for in AD to name computers. You would need to write your own.

Sue



Sean Pearce
Sean Pearce
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14370 Visits: 3542
Get the most recently added computer from active directory. Strip the alpha characters so only the number is left. Increase the number.



The SQL Guy @ blogspot

@SeanPearceSQL

About Me
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search